Repository navigation
ci: pin third-party actions to exact commit SHAs - #1186
Conversation
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
|
Preview deployment
Built from 0f97596. |
There was a problem hiding this comment.
🟢 Approval recommended
All four pinned SHAs were verified via the GitHub API to resolve exactly to their stated version tags, each action is referenced only once, and the change introduces no behavioral difference.
No open issues 🎉
What changed in this PR
This PR hardens the CI supply chain by pinning four third-party GitHub Actions from movable Git tags/branches (@v4, @v3, @v1, @v2) to the exact commit SHAs those references currently resolve to, keeping the human-readable version in a trailing comment. This mitigates the risk of an upstream publisher moving a tag to point at malicious code (as happened with tj-actions/changed-files in March 2025), while preserving current runtime behavior. It implements "option 2" from bosonprotocol/core-components#1046.
I verified each pinned SHA against the upstream repositories via the GitHub API, and all four correctly resolve to the stated version tags (e.g., 505e44b… → amannn/action-semantic-pull-request v4.6.0, 824c0e2… → ruby/setup-ruby v1.331.0, 773744… → marocchino/sticky-pull-request-comment v2.9.4, 9acf94a… → cloudflare/wrangler-action v3.15.0). Each action is used only once in the repo, and the actions deliberately left unpinned are clearly documented.
Changes:
- Pin
amannn/action-semantic-pull-request,ruby/setup-ruby,marocchino/sticky-pull-request-comment, andcloudflare/wrangler-actionto exact commit SHAs with version comments. - No behavioral change: each SHA matches the commit its former tag currently resolves to.
| File | Description |
|---|---|
.github/workflows/lint-pr.yaml |
Pins amannn/action-semantic-pull-request to 505e44b… (v4.6.0). |
.github/workflows/jekyll-gh-pages.yml |
Pins ruby/setup-ruby to 824c0e2… (v1.331.0). |
.github/workflows/deploy-preview.yaml |
Pins marocchino/sticky-pull-request-comment to 773744… (v2.9.4). |
.github/workflows/deploy_reusable.yaml |
Pins cloudflare/wrangler-action to 9acf94a… (v3.15.0). |
Review effort: Balanced
What this does
Pins 4 third-party action references in 4 files to the exact commit each tag points to today, with the version in a comment. This is option 2 from bosonprotocol/core-components#1046.
@v4can be moved by its publisher; a commit SHA cannot. That is what happened withtj-actions/changed-filesin March 2025.Pinned
.github/workflows/deploy-preview.yamlmarocchino/sticky-pull-request-comment@v2marocchino/sticky-pull-request-comment@7737449.github/workflows/deploy_reusable.yamlcloudflare/wrangler-action@v3cloudflare/wrangler-action@9acf94a.github/workflows/jekyll-gh-pages.ymlruby/setup-ruby@v1ruby/setup-ruby@824c0e2.github/workflows/lint-pr.yamlamannn/action-semantic-pull-request@v4amannn/action-semantic-pull-request@505e44bOne reference moved upstream since 19 Oct; pinned to what it resolves to today.
Full SHAs are in the diff.
marocchino/sticky-pull-request-comment: v2 is a branch; its head is the commit of release tag v2.9.4.ruby/setup-ruby: v1 is a branch; its head is the commit of release tag v1.331.0.Left as they are
.github/workflows/deploy_reusable.yamlline 267,getsentry/action-release@v1: It runs the container imageghcr.io/getsentry/action-release-image:1.11.0by tag, so pinning the action does not freeze what runs (rule R5). Your plan replaces it with a plainnpx @sentry/cli@<version>step; that needs a sentry-cli version and the release, commit-association and deploy calls the action makes, which is a choice for you rather than a mechanical swap. Left as it is..github/actions/setup-node-pnpm/action.ymlline 10,pnpm/action-setup@v4: allowed by name in the organisation list; your rule R1 says no pin.cloudflare/wrangler-actionandruby/setup-rubyinstall a tool at run time (your "check carefully" list in Cheap alternative to #1045: pin third-party actions by SHA and allow those exact SHAs at org level core-components#1046). Pinning freezes the action, not what it installs.How to check
On this pull request, these workflows start (no "workflow file issue") and pass:
In each job's "Set up job" log, the "Download action repository" lines show the pinned SHAs.
After the merge to
main:main: wrangler, and the Sentry release step (unchanged).main: the Ruby set-up.Once this is green, the organisation's "any version" entries for these actions can be swapped for the exact SHAs, but only for an action that no other repo still uses by tag.
Rollback: revert this merge.
Prepared by Claude for Justin; Ludo reviews and merges. Refs bosonprotocol/core-components#1046.
🤖 Generated with Claude Code