Skip to content

Pin third-party actions to full-length commit SHAs#5

Merged
taro-28 merged 1 commit into
mainfrom
chore/pin-actions-to-sha
May 27, 2026
Merged

Pin third-party actions to full-length commit SHAs#5
taro-28 merged 1 commit into
mainfrom
chore/pin-actions-to-sha

Conversation

@taro-28
Copy link
Copy Markdown
Member

@taro-28 taro-28 commented May 27, 2026

Summary

Pin every third-party uses: reference in action.yml, .github/workflows/test.yml, and .github/workflows/release.yml to a full-length commit SHA, keeping the resolved semver in a trailing comment (# vX.Y.Z).

Why

  • Composite-action interoperability under strict policies. GitHub Actions deployments that enforce only allow actions pinned to a full-length commit SHA evaluate the uses: steps inside a composite action's action.yml as well. Floating tag references such as @v3 / @v6 cause those environments to refuse to run bm-action. Pinning here unblocks them without requiring any change on the consumer side.
  • Security hardening recommendation from GitHub. The official Secure use reference recommends pinning third-party actions to a full-length commit SHA because tags are mutable and can be retargeted to malicious commits. Doing so across our own workflows keeps internal policy consistent with what we now require of dependencies.
  • No regression in update flow. Dependabot (already configured for github-actions ecosystem on a weekly schedule) recognises the <SHA> # <semver> convention and updates both the SHA and the comment together, so ongoing maintenance is unchanged.

Resolved versions

Action Pinned SHA Comment
actions/github-script 3a2844b7e9c422d3c10d287c895573f7108da1b3 v9.0.0
marocchino/sticky-pull-request-comment 0ea0beb66eb9baf113663a64ec522f60e49231c0 v3.0.4
actions/checkout de0fac2e4500dabe0009e67214ff5f5447ce83dd v6.0.2
actions/setup-node 48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e v6.4.0
softprops/action-gh-release b4309332981a82ec1c5618f44dd2e27cc8bfbfda v3.0.0
ludeeus/action-shellcheck 00cae500b08a931fb5698e11e79bfbd38e612a38 2.0.0

All floating tags were resolved against the upstream repositories at the time of this change and verified to point at the same commit as the listed semver tag (no behavioural change).

Test plan

  • Test workflow (bats / ShellCheck / integration on ubuntu+macOS / cli-install on ubuntu+macOS) passes on this PR
  • Verify grep -E 'uses: .+@' action.yml .github/workflows/*.yml shows every external reference in <owner>/<repo>@<40-char-sha> # <semver> form (the only exceptions being the local uses: ./ calls in test.yml)

🤖 Generated with Claude Code

Replace floating tag references (e.g. `@v6`) in `action.yml` and the
release / test workflows with full-length commit SHAs, keeping the
resolved semver in a trailing comment so Dependabot can continue to
update both the SHA and the comment in lockstep.

Rationale:
- Composite-action consumers running under "SHA pin required" GitHub
  Actions policies cannot use `bm-action` while internal `uses:` steps
  reference mutable tags; pinning unblocks those environments.
- GitHub's "Secure use reference" recommends pinning third-party actions
  to a full-length commit SHA because tags are mutable and can be moved
  to point at malicious commits.

Resolved versions:
- actions/github-script v9.0.0
- marocchino/sticky-pull-request-comment v3.0.4
- actions/checkout v6.0.2
- actions/setup-node v6.4.0
- softprops/action-gh-release v3.0.0
- ludeeus/action-shellcheck 2.0.0
@github-actions
Copy link
Copy Markdown

mock sync output

@github-actions
Copy link
Copy Markdown

mock sync output

@github-actions
Copy link
Copy Markdown

mock sync output

@github-actions
Copy link
Copy Markdown

mock sync output

@taro-28 taro-28 marked this pull request as ready for review May 27, 2026 05:00
@taro-28 taro-28 requested a review from a team as a code owner May 27, 2026 05:00
@taro-28 taro-28 requested review from m-shaka and yebis0942 May 27, 2026 05:00
@taro-28 taro-28 self-assigned this May 27, 2026
@taro-28 taro-28 merged commit a9133e8 into main May 27, 2026
6 checks passed
@taro-28 taro-28 deleted the chore/pin-actions-to-sha branch May 27, 2026 06:11
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.

3 participants