feat: suggest SHA-pinned GitHub Actions updates instead of bare tags - #17
Merged
Conversation
yul's GitHub Actions checker now resolves the commit SHA behind a newly-released tag and suggests `@<sha> # vX.Y.Z` as the replacement, matching the security-recommended pin convention this repo's own workflows already use, instead of just bumping to the bare tag. Mismatch gained an optional Suggested field carrying that exact replacement text; the hook's stderr message and the session-start scan's additionalContext both prefer it over Latest when set. A failed SHA lookup fails open, same as other resolver errors here: the mismatch is still reported, just without the SHA suggestion. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
algomaster99
commented
Aug 16, 2026
Trim redundant doc comments, add an example to repoOf's, rename fakeShaResolver to mockShaResolver, and tighten Mismatch.Suggested's doc comment per algomaster99's review.
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.
Summary
yul's GitHub Actions checker now resolves the commit SHA behind a newly-released tag and suggests pinning to@<sha> # vX.Y.Zinstead of the bare tag - the security-recommended convention this repo's own workflows (.github/workflows/*.yml) already use.Before:
After:
Changes
pkg/githubactions/sha.go(new):ShaResolverinterface +GitHubShaResolver, resolving a tag's commit SHA via the GitHub REST API (GET /repos/{repo}/commits/{tag}), honoringGITHUB_TOKENfor a higher rate limit if set.pkg/util/mismatch.Mismatch: new optionalSuggestedfield carrying the exact replacement text, used only by the GitHub Actions checker.pkg/githubactions/workflow.go:Checkergained aSha ShaResolverfield;CheckWorkflowsetsMismatch.Suggestedto"<sha> # <tag>"when resolution succeeds. A failed SHA lookup fails open - the mismatch is still reported with the plain tag, same treatment as other resolver errors in this codebase.main.go: wires upgithubactions.GitHubShaResolver{}; both thePreToolUsehook's stderr message and the session-start scan'sadditionalContextpreferSuggestedoverLatestwhen present.🤖 Generated with Claude Code