Skip to content

Pin actions to commit SHAs - #88

Merged
dblock merged 1 commit into
masterfrom
dblock/pin-actions
Nov 20, 2026
Merged

dblock merged 1 commit into
masterfrom
dblock/pin-actions

Conversation

@dblock

@dblock dblock commented Nov 20, 2026

Copy link
Copy Markdown
Owner

Summary

From the review of ruby-grape/grape#3078: pinning the reusable workflow by SHA freezes the workflow file, but not the actions it uses. At v0.7.0 the release job runs actions/checkout@v7, ruby/setup-ruby@v1, and actions/upload-artifact@v7 by tag, and ruby/setup-ruby@v1 is a branch (there is no v1 tag). That job can request a RubyGems token.

  • Pin every external action and reusable workflow to the commit of its latest release, with the version as a trailing comment, in .github/workflows/release.yml, the composite action.yml, and this repository's own workflows:
    • actions/checkout v7.0.1 (3d3c42e)
    • ruby/setup-ruby v1.343.0 (be3c7df)
    • actions/upload-artifact v7.0.2 (cf430e0)
    • coverallsapp/github-action v2.3.8 (8d6379e)
    • danger/danger-pr-comment reusable workflows v0.3.0 (645e89b)
  • Add .github/dependabot.yml for weekly GitHub Actions updates, which update the SHA and the version comment together.
  • A spec fails if any uses: outside local ./ workflows isn't a 40-character SHA with a version comment.
  • DESIGN, AGENTS, and the workflow reference document the rule and recommend that callers pin release.yml by SHA with the tag as a comment.

Validation

  • bundle exec rake: RuboCop (including spellcheck) and all unit and integration specs pass.
  • bundle exec rake build and actionlint pass.
  • Each SHA was resolved with gh api repos/<owner>/<repo>/commits/<latest release tag>.

This PR was written by an AI (Claude) acting on behalf of @dblock.

🤖 Generated with Claude Code

https://claude.ai/code/session_011Gr21j6KD4oksnhmZ5u3pr

A caller pinning the reusable workflow by SHA froze the workflow file but
not the actions it uses: `actions/checkout@v7`, `actions/upload-artifact@v7`,
and `ruby/setup-ruby@v1`, which is a branch, all moved, and they run in
the job that can request a RubyGems token. Pin every external action and
reusable workflow in both interfaces and this repository's workflows to
the commit of its latest release, with the version as a comment, and let
Dependabot propose updates. A spec rejects unpinned references.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011Gr21j6KD4oksnhmZ5u3pr
@dblock
dblock force-pushed the dblock/pin-actions branch from 8b63f97 to a7d436c Compare November 20, 2026 23:18
@dblock
dblock merged commit 0923ca2 into master Nov 20, 2026
11 checks passed
@dblock
dblock deleted the dblock/pin-actions branch November 20, 2026 23:19
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.

1 participant