This commit is contained in:
Jean-Baptiste Louazel 2025-09-17 03:38:13 +09:00 committed by GitHub
commit e14dd1e531
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 9 additions and 0 deletions

View file

@ -53,6 +53,10 @@ All inputs are optional.
<td><code>components</code></td> <td><code>components</code></td>
<td>Comma-separated string of additional components to install e.g. <code>clippy, rustfmt</code></td> <td>Comma-separated string of additional components to install e.g. <code>clippy, rustfmt</code></td>
</tr> </tr>
<tr>
<td><code>set-default</code></td>
<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>
</tr>
</table> </table>
<br> <br>

View file

@ -18,6 +18,10 @@ inputs:
components: components:
description: Comma-separated list of components to be additionally installed description: Comma-separated list of components to be additionally installed
required: false required: false
set-default:
description: Whether to set the installed toolchain as the rustup default (rustup default <toolchain>)
required: false
default: 'true'
outputs: outputs:
cachekey: cachekey:
@ -94,6 +98,7 @@ runs:
shell: bash shell: bash
- run: rustup default ${{steps.parse.outputs.toolchain}} - run: rustup default ${{steps.parse.outputs.toolchain}}
if: ${{inputs['set-default'] == 'true'}}
shell: bash shell: bash
continue-on-error: true # https://github.com/dtolnay/rust-toolchain/issues/127 continue-on-error: true # https://github.com/dtolnay/rust-toolchain/issues/127