Skip to content

Commit a7d436c

Browse files
dblockclaude
andcommitted
Pin actions to commit SHAs
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
1 parent 14f5e32 commit a7d436c

15 files changed

Lines changed: 45 additions & 24 deletions

‎.github/dependabot.yml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: github-actions
4+
directory: /
5+
schedule:
6+
interval: weekly

‎.github/workflows/danger-comment.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@ permissions:
1212

1313
jobs:
1414
comment:
15-
uses: danger/danger-pr-comment/.github/workflows/danger-comment.yml@v0.3.0
15+
uses: danger/danger-pr-comment/.github/workflows/danger-comment.yml@645e89bcc7be89ee7e8362166110b05cbced8e59 # v0.3.0
1616
with:
1717
comment-empty: false

‎.github/workflows/danger.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ permissions:
99

1010
jobs:
1111
danger:
12-
uses: danger/danger-pr-comment/.github/workflows/danger-run.yml@v0.3.0
12+
uses: danger/danger-pr-comment/.github/workflows/danger-run.yml@645e89bcc7be89ee7e8362166110b05cbced8e59 # v0.3.0
1313
with:
1414
ruby-version: '4.0'
1515
bundler-cache: true

‎.github/workflows/lint.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
lint:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v7
15+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1616
with:
1717
persist-credentials: false
18-
- uses: ruby/setup-ruby@v1
18+
- uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0
1919
with:
2020
ruby-version: '4.0'
2121
bundler-cache: true

‎.github/workflows/package.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ jobs:
1212
package:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v7
15+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
1616
with:
1717
persist-credentials: false
18-
- uses: ruby/setup-ruby@v1
18+
- uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0
1919
with:
2020
ruby-version: '4.0'
2121
bundler-cache: true

‎.github/workflows/release-integration.yml‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ jobs:
2020
- { ruby: '4.0', suite: workflow }
2121
- { ruby: '4.0', suite: consumer }
2222
steps:
23-
- uses: actions/checkout@v7
23+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2424
with:
2525
persist-credentials: false
26-
- uses: ruby/setup-ruby@v1
26+
- uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0
2727
with:
2828
ruby-version: ${{ matrix.entry.ruby }}
2929
bundler-cache: true

‎.github/workflows/release.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ jobs:
8787
RUBYGEMS_OWNER_ID: ${{ inputs.rubygems-owner }}
8888
TZ: ${{ inputs.timezone }}
8989
steps:
90-
- uses: actions/checkout@v7
90+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
9191
id: checkout
9292
with:
9393
fetch-depth: 0
94-
- uses: ruby/setup-ruby@v1
94+
- uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0
9595
id: setup_ruby
9696
with:
9797
ruby-version: ${{ inputs.ruby-version }}
@@ -120,11 +120,11 @@ jobs:
120120
RUBYGEMS_OWNER_ID: ${{ inputs.rubygems-owner }}
121121
TZ: ${{ inputs.timezone }}
122122
steps:
123-
- uses: actions/checkout@v7
123+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
124124
id: checkout
125125
with:
126126
fetch-depth: 0
127-
- uses: ruby/setup-ruby@v1
127+
- uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0
128128
id: setup_ruby
129129
with:
130130
ruby-version: ${{ inputs.ruby-version }}
@@ -182,7 +182,7 @@ jobs:
182182
run: bundle exec rake release:workflow:checkpoint
183183
- name: Preserve Release Artifacts
184184
id: preserve_release_artifacts
185-
uses: actions/upload-artifact@v7
185+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
186186
with:
187187
name: release-gem-${{ env.RELEASE_VERSION }}-${{ github.run_id }}-${{ github.run_attempt }}
188188
path: |

‎.github/workflows/test.yml‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ jobs:
1818
- { ruby: '3.3' }
1919
- { ruby: '4.0' }
2020
steps:
21-
- uses: actions/checkout@v7
21+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
2222
with:
2323
persist-credentials: false
24-
- uses: ruby/setup-ruby@v1
24+
- uses: ruby/setup-ruby@be3c7df29b3349ec6bcfc6b4792f1cf9f5237d18 # v1.343.0
2525
with:
2626
ruby-version: ${{ matrix.entry.ruby }}
2727
bundler-cache: true
@@ -33,7 +33,7 @@ jobs:
3333
RELEASE_AUTH_MODE: rubygems
3434
- name: Send Coverage to Coveralls
3535
if: matrix.entry.ruby == '4.0'
36-
uses: coverallsapp/github-action@v2
36+
uses: coverallsapp/github-action@8d6379e14d29928660c4ba802d8e85393440b329 # v2.3.8
3737
with:
3838
github-token: ${{ secrets.GITHUB_TOKEN }}
3939
path-to-lcov: coverage/lcov.info

‎.spellcheck.txt‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Commonmarker
77
codename
88
customizations
99
dblock
10+
Dependabot
1011
ExecutionContext
1112
ExecutionProvider
1213
gemspec
@@ -48,6 +49,7 @@ rulesets
4849
RSpec
4950
RuboCop
5051
RubyGems
52+
SHA
5153
strftime
5254
subclasses
5355
subprocess

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Keep orchestration permutations and YAML assertions in focused source specs (`bu
1212

1313
Keep semantic releases opt-in. Calculate from reachable released tags, not development versions; persist one immutable decision across processes, preserve it when recording the next version, and never reanalyze during preparation or publication. Preserve manual workflow defaults and publication guards. Semantic consumer fixtures must verify success, publication failure, and empty-release rejection against the installed artifact without real publication.
1414

15-
The root `action.yml` exposes the same Ruby tasks as a composite action. Keep both interfaces consistent without making version-pinned workflows depend on moving action references. Action callers own job permissions, runner, environment, and concurrency. Preserve authentication selection and failure-aware artifact preservation; run installed-artifact consumer CI and `actionlint .github/workflows/*.yml examples/.github/workflows/*.yml` when changing YAML interfaces.
15+
The root `action.yml` exposes the same Ruby tasks as a composite action. Keep both interfaces consistent without making version-pinned workflows depend on moving action references: pin every external action and reusable workflow to a full commit SHA with its version as a trailing comment, never a tag or branch. Action callers own job permissions, runner, environment, and concurrency. Preserve authentication selection and failure-aware artifact preservation; run installed-artifact consumer CI and `actionlint .github/workflows/*.yml examples/.github/workflows/*.yml` when changing YAML interfaces.
1616

1717
Run `bundle exec rake` locally for specs and RuboCop before every push, and `bundle exec rake build` for package construction when applicable. Danger checks the changelog in PR CI, not as a routine local command. Document user-visible changes in `CHANGELOG.md`, listing entries within each release chronologically and keeping `- Your contribution here.` as the last entry in the next-release section; keep Markdown paragraphs on one source line.
1818

0 commit comments

Comments
 (0)