Pin GitHub Actions to commit SHAs#779
Open
necolas wants to merge 2 commits into
Open
Conversation
Pin every external action (checkout, upload/download-artifact, cache, setup-bun, stickydisk) to a full commit SHA with a trailing version comment, so a moved tag can't silently change what runs in CI. SHAs were resolved from each action's published release tags.
Add a Dependabot github-actions config that opens grouped weekly PRs to bump the pinned SHAs and their version comments. It needs two entries because directory:/ only scans .github/workflows; the second covers the shared composite at .github/actions/setup. Add an actions-pinned CI job that fails any change introducing an external action referenced by a tag or branch instead of a full commit SHA (local ./ actions are exempt), so the pinning policy can't silently regress.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Pins every third-party action to a full commit SHA and adds the tooling to keep that policy fresh and enforced. A version tag like
@v4is mutable and whoever controls the action can repoint it at new code; SHA pinning isa way to mitigate supply-chain risks of actions we don't own.
Changes
checkout,upload/download-artifact,cache,setup-bun,stickydisk), each annotated with its# vX.Y.Z.github-actions, weekly, grouped) opens a single PR to bumpthe SHAs and their version comments. Uses
directorieswith a/.github/actions/*glob so the CI workflows and every local composite action are covered.
actions-pinnedCI job fails any change that introduces an externalaction referenced by tag/branch instead of a 40-char SHA (local
./actionsexempt), so the policy can't silently regress.
Notes
from each action's current release.
Actions pinned to SHAto themainbranch-protectionrequired checks so the guard blocks rather than just advises. Dependabot only
activates once
dependabot.ymlis on the default branch.