ci: pin GitHub Actions to commit SHAs - #22
Merged
Merged
Conversation
A mutable major tag (`@v7`, `@v4`) is a moving target: upstream can retarget it at any time, and these workflows hold production credentials. Pinning to a full commit SHA makes the code that runs deterministic. Each `uses:` keeps its version in a trailing comment (`# v7`) so the file stays readable, and Dependabot's `github-actions` ecosystem — already configured here — uses that comment to keep both the SHA and the annotation current. Every SHA was resolved from the tag it currently points at via `/repos/<owner>/<repo>/git/ref/tags/<tag>`, dereferencing annotated tag objects to their commit, and re-resolved per repo rather than copied between them. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VDD6P9ft7DNNbrXpNWvCsk
|
| Filename | Overview |
|---|---|
| .github/workflows/plugin-inspector.yml | Pins checkout, setup-node, and upload-artifact without changing the validation job's inputs or behavior. |
| .github/workflows/publish-clawhub.yml | Pins checkout and setup-node while preserving the existing ClawHub publication flow. |
| .github/workflows/publish-homebrew.yml | Pins checkout while retaining the external tap repository and token configuration. |
| .github/workflows/publish-npm.yml | Pins checkout and setup-node without altering Node 24 or npm registry configuration. |
Reviews (1): Last reviewed commit: "ci: pin GitHub Actions to commit SHAs" | Re-trigger Greptile
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
uses:in this repo's workflows to a full 40-character commit SHA, keeping the version as a trailing comment.Why. An upstream tag retarget on a mutable major (
@v7,@v4) silently changes the code that runs — including in workflows that hold production Cloudflare tokens. A SHA cannot be moved.Why this stays maintainable. Dependabot's
github-actionsecosystem is already configured in this repo, and it reads the trailing# vNcomment to keep both the pin and the annotation current. Pinning without it would just freeze the actions.How the SHAs were resolved. Each from the tag it currently points at, via
gh api /repos/<owner>/<repo>/git/ref/tags/<tag>, dereferencing annotated tag objects through/git/tags/<sha>to the underlying commit. Resolved per repo, not copied between repos — different repos sit on different majors.Verification. A wrong SHA fails at run time, not parse time, so a green run on this PR is the proof the pins resolve.
Pinned
.github/workflows/plugin-inspector.yml | 6 +++---
.github/workflows/publish-clawhub.yml | 4 ++--
.github/workflows/publish-homebrew.yml | 2 +-
.github/workflows/publish-npm.yml | 4 ++--
4 files changed, 8 insertions(+), 8 deletions(-)
🤖 Generated with Claude Code
https://claude.ai/code/session_01VDD6P9ft7DNNbrXpNWvCsk