Pin GitHub Actions to commit SHAs - #44
Conversation
Actions were referenced by floating major tags, so moving a tag runs new code in CI with repository credentials. Pinning to a commit removes that: the workflow runs the exact tree that was reviewed. The trailing version comment is what Dependabot reads to track the current release, so it updates both the SHA and the comment. Note setup-php tags without a v prefix.
|
Warning Review limit reachedNext included review available in 4 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Closing: SHA-pinning is not the convention in this ecosystem. Nelmio, maker-bundle and DoctrineBundle all use floating tags; api-platform/core is the outlier that pins. The Dependabot's |
Follows #42, which turned on Dependabot's
github-actionsupdates. This removes the remaining exposure those updates cannot address.Why
Actions were referenced by floating major tags:
A tag is mutable. Whoever controls the action repository — or anyone who compromises it — can repoint
v7at a different commit, and CI will run that code with the repository's credentials on the next build. That is the mechanism behind the 2025tj-actions/changed-filescompromise, where a moved tag exfiltrated secrets from every workflow using it. Dependabot version updates do not help: they keep the tag current, but the tag is the thing that moves.Pinning to a commit SHA means the workflow runs the exact tree that was reviewed.
What changed
Same versions currently in use — no upgrade is bundled in here.
The trailing comment is not decoration: Dependabot reads it to know the current release, and updates the SHA and the comment together. So this keeps working with the config added in #42, and updates arrive as reviewable diffs showing both the old and new commit.
Verification
Each pinned SHA was resolved back through the GitHub API and confirmed to be the commit its tag points at. That check caught one error before it shipped:
shivammathur/setup-phptags without avprefix, so the comment reads2.37.2, notv2.37.2. A wrong comment would have left Dependabot unable to track the version.