Repository navigation
ci: Resolve most zizmor findings as of zizmor@1.31.1
#3045
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Kobzol
merged 8 commits into
rust-lang:main
from
hashcatHitman:ref-version-mismatch_and_stale-action-refs_and_unpinned-uses
Oct 26, 2026
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
08409d1
ci: Ignore `unpinned-uses` for `josh-sync/rustc-pull`
hashcatHitman 4ff64e4
ci: Pin `actions/cache` to 4.3.0 hash
hashcatHitman 27f1588
ci: Pin `actions/checkout` to 7.0.1 hash
hashcatHitman 59b517f
ci: Pin `actions/github-script` to 7.1.0 hash
hashcatHitman c026b14
ci: Disable credential persistence
hashcatHitman f8c74dd
ci: Prefer shell expansion over template expansion
hashcatHitman 9bc273a
ci: Disable all permissions by default
hashcatHitman a688144
ci: Grant minimum required permissions
hashcatHitman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this change? Is
GITHUB_TOKENeven passed as an environment variable by default?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
template-injectionlint. Even when not necessarily dangerous,zizmorconsiders template expansions a code smell.I don't think so, but in this case, it was already explicitly put into the environment:
rustc-dev-guide/.github/workflows/ci.yml
Lines 12 to 23 in 6986caf
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. It seems safer to not put it into the environment and only access it through secrets, but I don't know if there is anything else here that might be reading it.
FWIW, I don't like this lint being applied to things that are clearly safe from expansion attacks, such as
secrets.GITHUB_TOKEN.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, that's the tricky part. There's only so much I can do to test these things on my own (I already accidentally used up all my free minutes for this month doing so, it seems... oops!), so I have to try to err on the side of "not breaking infrastructure".
I think it isn't really meaningfully safer, though I would definitely prefer the scope be reduced (env for a specific step, rather than the entire job). That suffers the same "I don't know what might be using this already" problem, though.
Ideally, the token only grants read permissions/none at all and is not really a concern regardless for public repos. Which I think is the relationship
permissions: {}creates? It's a little unclear how that works.