Skip to content

Commit 15ce610

Browse files
committed
Add set-default input
Adds new `set-default` input (default: true) to control whether `rustup default <toolchain>` is executed. Signed-off-by: Jean-Baptiste Louazel <[email protected]>
1 parent e97e2d8 commit 15ce610

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,10 @@ All inputs are optional.
5353
<td><code>components</code></td>
5454
<td>Comma-separated string of additional components to install e.g. <code>clippy, rustfmt</code></td>
5555
</tr>
56+
<tr>
57+
<td><code>set-default</code></td>
58+
<td>Whether to set the installed toolchain as the active default via <code>rustup default &lt;toolchain&gt;</code>. Defaults to <code>true</code>. Set to <code>false</code> if you only plan to use the toolchain with explicit <code>+toolchain</code> overrides in your commands and don't want to change the runner's global default.</td>
59+
</tr>
5660
</table>
5761
5862
<br>

action.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ inputs:
1818
components:
1919
description: Comma-separated list of components to be additionally installed
2020
required: false
21+
set-default:
22+
description: Whether to set the installed toolchain as the rustup default (rustup default <toolchain>)
23+
required: false
24+
default: 'true'
2125

2226
outputs:
2327
cachekey:
@@ -94,6 +98,7 @@ runs:
9498
shell: bash
9599

96100
- run: rustup default ${{steps.parse.outputs.toolchain}}
101+
if: ${{inputs['set-default'] == 'true'}}
97102
shell: bash
98103
continue-on-error: true # https://github.com/dtolnay/rust-toolchain/issues/127
99104

0 commit comments

Comments
 (0)