Skip to content

Pin GitHub Action references to commit SHAs#225

Merged
thpierce merged 1 commit intomainfrom
pin-github-actions-sha
Mar 18, 2026
Merged

Pin GitHub Action references to commit SHAs#225
thpierce merged 1 commit intomainfrom
pin-github-actions-sha

Conversation

@thpierce
Copy link
Contributor

Summary

Pin all GitHub Action references to full commit SHAs instead of mutable version tags to prevent supply chain attacks. This is a security best practice recommended by GitHub's security hardening guide.

Mutable version tags (e.g. @v2) can be moved to point to different commits, meaning a compromised upstream action could execute malicious code in our workflows. Pinning to commit SHAs ensures we always run the exact code we've reviewed.

Changes

Old Reference New Reference Hash Version
actions/cache@v2 actions/cache@2b250bc 2b250bc32ad02700b996b496c14ac8c2840a2991 v2.1.8
actions/checkout@v2 actions/checkout@ee0669b ee0669bd1cc54295c223e0bb666b733df41de1c5 v2.7.0
actions/setup-node@v3 actions/setup-node@3235b87 3235b876344d2a9aa001b8d1453c930bba69e610 v3.9.1
actions/stale@v6 actions/stale@5ebf00e 5ebf00ea0e4c1561e9b43a292ed34424fb1d4578 v6.0.1
aws-actions/configure-aws-credentials@v1 aws-actions/configure-aws-credentials@67fbcbb 67fbcbb121271f7775d2e7715933280b06314838 v1.7.0
benchmark-action/github-action-benchmark@v1 benchmark-action/github-action-benchmark@a7bc236 a7bc2366eda11037936ea57d811a43b3418d3073 v1.21.0
docker/build-push-action@v3 docker/build-push-action@1104d47 1104d471370f9806843c095c1db02b5a90c5f8b6 v3.3.1
docker/login-action@v2 docker/login-action@465a078 465a07811f14bebb1938fbed4728c6a1ff8901fc v2.2.0
docker/setup-buildx-action@v2 docker/setup-buildx-action@885d146 885d1462b80bc1c1c7f0b00334ad271f09369c55 v2.10.0
github/codeql-action/analyze@v2 github/codeql-action@b8d3b6e b8d3b6e8af63cde30bdc382c0bc28114f4346c88 v2.28.1
github/codeql-action/autobuild@v2 github/codeql-action@b8d3b6e b8d3b6e8af63cde30bdc382c0bc28114f4346c88 v2.28.1
github/codeql-action/init@v2 github/codeql-action@b8d3b6e b8d3b6e8af63cde30bdc382c0bc28114f4346c88 v2.28.1
JasonEtco/create-an-issue@v2 JasonEtco/create-an-issue@1b14a70 1b14a70e4d8dc185e5cc76d3bec9eab20257b2c5 v2.9.2

Static Code Check

Added a static-code-checks job to pr-build.yml that will fail PRs introducing mutable GitHub Action version references.

@thpierce thpierce merged commit 705659b into main Mar 18, 2026
7 checks passed
@thpierce thpierce deleted the pin-github-actions-sha branch March 18, 2026 20:53
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.

1 participant