ci: pin github actions to commit shas - #659
Merged
Merged
Conversation
Tags and branches are mutable refs: an attacker who compromises an action repo can repoint them at malicious code that runs with our workflow secrets. Pin every third-party action to an immutable commit SHA, keeping the version as a trailing comment so the refs stay readable and dependabot can still bump them.
Contributor
Greptile SummaryThis PR hardens GitHub Actions supply-chain integrity by replacing mutable third-party action tags and branches with immutable commit SHAs while retaining readable version or channel comments.
Confidence Score: 5/5The PR appears safe to merge because the changes consistently replace mutable external action references with immutable SHA pins without establishing any workflow regression. The diff changes only external action references and trailing comments, preserves existing action inputs and version distinctions, and introduces no supported functional or security failure. Important Files Changed
Reviews (1): Last reviewed commit: "ci: pin github actions to commit shas" | Re-trigger Greptile |
amilz
approved these changes
Sep 1, 2026
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
uses:refs across 16 files under.github/(15 workflows + thesetup-solanacomposite action) from mutable tags/branches to immutable 40-hex commit SHAs.@v4or@stableat new code, and that code then runs inside our jobs with whatever secrets andGITHUB_TOKENscopes the step has. A commit SHA cannot be moved, so a pinned ref is the only ref that means "exactly the code we reviewed".dopplerhq/secrets-fetch-action(3 uses),google-github-actions/auth(1),docker/login-action(2). These see registry tokens, Doppler service tokens, and GCP workload-identity credentials.dtolnay/rust-toolchainselects the Rust channel by branch name, so each channel is pinned to its own branch head and keeps the branch name as its comment: 6 uses of# stable, 3 of# master. These are deliberately different SHAs and must not be collapsed into one.# <version>comment, matching the convention already used by the pre-existing pin inrust-publish.yml. It preserves readability at a glance and is the form dependabot reads to bump SHA-pinned actions.Test Plan
grep -rn "uses:" .github/returns zero refs that are not a 40-hex SHA, excluding local./composite/reusable-workflow refs (intentionally untouched).git difftouches only the ref portion ofuses:lines: 79 insertions, 79 deletions, no other lines changed.Notes
uses: ./...composite actions and reusable workflows, and the already-SHA-pinnedrust-lang/crates-io-auth-actioninrust-publish.yml.