Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mention quotes for toolchain #91

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

rikhuijzer
Copy link

I've re-learned the importance of quotes the hard way 馃槄

Preview

image

@rikhuijzer rikhuijzer changed the title Mention quotes for version Mention quotes for toolchain Jun 26, 2023
@@ -86,15 +88,15 @@ compiler support.
# offset, which may be written in years, months, weeks, or days.
- uses: dtolnay/rust-toolchain@master
with:
toolchain: stable 18 months ago
toolchain: 'stable 18 months ago'
Copy link
Author

Choose a reason for hiding this comment

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

The quotes are not necessary here, but it's a good habit to use quotes in YAML. Or as someone on HN said it: "save yourself pain. Always quote" (https://news.ycombinator.com/item?id=34509789).

@@ -43,6 +43,8 @@ All inputs are optional.
Rustup toolchain specifier e.g. <code>stable</code>, <code>nightly</code>, <code>1.42.0</code>, <code>nightly-2022-01-01</code>.
<b>Important: the default is to match the @rev as described above.</b>
When passing an explicit <code>toolchain</code> as an input instead of @rev, you'll want to use "dtolnay/rust-toolchain@master" as the revision of the action.
<b>Also important: use quotes to ensure that the right toolchain version is passed to this GitHub Action.</b>
For example, specify <code>toolchain: '1.70'</code> (with quotes) because <code>toolchain: 1.70</code> will be parsed as <code>toolchain: 1.7</code>.

Choose a reason for hiding this comment

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

Couldn't this be fixed instead? I assume it is only an issue if you parse through serde_yaml::Value?

fn main() {
    dbg!(serde_yaml::from_str::<Foo>("v: 1.70").unwrap());
}

#[derive(serde::Deserialize, Debug)]
struct Foo {
    v: String
}
[src/main.rs:2] serde_yaml::from_str::<Foo>("v: 1.70").unwrap() = Foo {
    v: "1.70",
}

Choose a reason for hiding this comment

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

github actions go through YAML

0xbe7a added a commit to 0xbe7a/rattler-build that referenced this pull request Dec 16, 2023
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.

None yet

3 participants