Skip to content

Allow disabling rustup default step#144

Closed
BD103 wants to merge 3 commits intodtolnay:masterfrom
BD103:make-default
Closed

Allow disabling rustup default step#144
BD103 wants to merge 3 commits intodtolnay:masterfrom
BD103:make-default

Conversation

@BD103
Copy link
Copy Markdown

@BD103 BD103 commented Apr 22, 2025

I'm writing an action that needs a specific Rustup nightly toolchain, but I do not want to override the default toolchain installed by users of my action (which is usually stable or a different nightly version). This PR adds a new make-default input (feel free to change the name) that allows you to configure whether rustup default is run:

# Install the stable toolchain and make it the default.
- uses: dtolnay/rust-toolchain@master
  with:
    toolchain: stable

# Install the nightly toolchain, but keep stable as the default.
# You must explicitly select `cargo +nightly` or `rustup run nightly` to use it.
- uses: dtolnay/rust-toolchain@master
  with:
    toolchain: nightly
    make-default: false

make-default is true by default, meaning the original behavior is kept. (It's not a breaking change!) make-default supports the values true or false, though the string forms of 'true' or "true" also work. (Within the action, make-default is coerced to a string and then compared with == 'true'.)

I've tested my changes using this workflow, which I've run here.

Thank you!

Copy link
Copy Markdown
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR, but I would prefer not to support customizing this. You should use a fork or a different action.

@dtolnay dtolnay closed this Apr 22, 2025
BD103 added a commit to TheBevyFlock/bevy_cli that referenced this pull request Apr 22, 2025
@BD103
Copy link
Copy Markdown
Author

BD103 commented Apr 22, 2025

Thanks for the PR, but I would prefer not to support customizing this. You should use a fork or a different action.

That's disappointing, but I understand. Thank you for considering this anyways!

@BD103 BD103 deleted the make-default branch April 22, 2025 18:23
BD103 added a commit to TheBevyFlock/bevy_cli that referenced this pull request Apr 25, 2025
This PR adds support for installing `bevy_lint` in CI. (Motivated by
TheBevyFlock/bevy_new_2d#365, caused
dtolnay/rust-toolchain#144.)

```yml
- name: Install `bevy_lint`
  uses: TheBevyFlock/bevy_cli/bevy_lint@main

- name: Run `bevy_lint`
  run: bevy_lint --workspace
```

In the process, I also wrote a workflow to test the action. I also plan
on updating the docs and contributing guide for this feature.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants