Skip to content

ci: pin GitHub Actions to full commit SHAs - #677

Merged
ShotaroKataoka merged 3 commits into
mainfrom
crew/pin-actions-sha
Nov 30, 2026
Merged

ShotaroKataoka merged 3 commits into
mainfrom
crew/pin-actions-sha

Conversation

@ShotaroKataoka

Copy link
Copy Markdown
Contributor

🤖 KiroCrew automated PR -- created by KiroCrew on behalf of the maintainer.

Summary

Pins every third-party action in .github/workflows/ to a full 40-character commit SHA, with the tag kept as a comment (uses: actions/checkout@<sha> # v7.0.1).

Why: a tag like @v7 can be moved by the action's owner at any time, so a compromised or re-tagged release would run in our CI with our token. A commit SHA cannot be moved. ASH's semgrep rule github-actions-mutable-action-tag (HIGH) flags these refs.

installer.yml, release.yml and dependabot-auto-merge.yml were already pinned. This brings the other four files in line, using the same SHAs where the same action is already pinned.

Action Old ref Pinned to Uses
actions/checkout v7 3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 12
actions/setup-python v7 6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0 5
actions/setup-node v7.1.0 949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0 3
actions/upload-artifact v7 cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2 2
actions/github-script v9 3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 1
astral-sh/setup-uv v10.3.3 68559e99cc807c1eb7e9238fd43a15bba460eec2 # v10.3.3 4
docker/setup-buildx-action v4 f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 2
docker/build-push-action v7 c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7.4.0 2

31 refs in ash.yml, blog-draft.yml, ci.yml and require-blog-label.yml. Each floating major tag (v7, v4, v9) points today to the same commit as the patch tag named in the comment, so CI runs exactly the same code. Exact tags (v7.1.0, v10.3.3) were kept as they are. No version was bumped.

Staying fresh: .github/dependabot.yml already has a weekly github-actions entry. Dependabot updates SHA pins and their # vX.Y.Z comments together, so no new config is needed.

No workflow logic, permissions or triggers changed. No CHANGELOG entry: CI-only changes are not logged there.

Tests

  • All workflow files and dependabot.yml load with yaml.safe_load.
  • grep finds no uses: owner/repo@ref under .github/ without a 40-char SHA.
  • Each SHA was read from gh api repos/<owner>/<repo>/commits/<tag>.

Credit

Based on #329 by @kohoto, which was closed right after it was opened. The commit carries a Co-authored-by trailer for them.

Mutable tags can be moved by the action owner; a full SHA cannot. Each pin is the commit the current tag points to, with the tag kept as a trailing comment so Dependabot keeps updating both.

Based on #329 by @kohoto.

Co-authored-by: kohoto <kohoto@users.noreply.github.com>
@ShotaroKataoka ShotaroKataoka added the kirocrew Created by KiroCrew (automated) label Nov 22, 2026
@ShotaroKataoka ShotaroKataoka added the blog:skip ブログ対象外 label Nov 30, 2026
@ShotaroKataoka
ShotaroKataoka enabled auto-merge (squash) November 30, 2026 06:45
@ShotaroKataoka
ShotaroKataoka merged commit 65b2e27 into main Nov 30, 2026
18 checks passed
@ShotaroKataoka
ShotaroKataoka deleted the crew/pin-actions-sha branch November 30, 2026 06:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

blog:skip ブログ対象外 kirocrew Created by KiroCrew (automated)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant