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