From 15ce61073f587a53c02c49c036a9c4685f5814e2 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Louazel Date: Mon, 15 Sep 2025 18:06:58 +0200 Subject: [PATCH] Add `set-default` input Adds new `set-default` input (default: true) to control whether `rustup default ` is executed. Signed-off-by: Jean-Baptiste Louazel --- README.md | 4 ++++ action.yml | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/README.md b/README.md index fc44f15..e31b467 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,10 @@ All inputs are optional. components Comma-separated string of additional components to install e.g. clippy, rustfmt + + set-default + Whether to set the installed toolchain as the active default via rustup default <toolchain>. Defaults to true. Set to false if you only plan to use the toolchain with explicit +toolchain overrides in your commands and don't want to change the runner's global default. +
diff --git a/action.yml b/action.yml index b48984a..ef8c015 100644 --- a/action.yml +++ b/action.yml @@ -18,6 +18,10 @@ inputs: components: description: Comma-separated list of components to be additionally installed required: false + set-default: + description: Whether to set the installed toolchain as the rustup default (rustup default ) + required: false + default: 'true' outputs: cachekey: @@ -94,6 +98,7 @@ runs: shell: bash - run: rustup default ${{steps.parse.outputs.toolchain}} + if: ${{inputs['set-default'] == 'true'}} shell: bash continue-on-error: true # https://github.com/dtolnay/rust-toolchain/issues/127