Skip to content

Commit e36e1d6

Browse files
TMHSDigitalclaude
andcommitted
ci: pin every GitHub Action to a commit SHA
Each uses: now names a full commit SHA with the tag it resolved from as a comment, so a retagged action cannot run with the release jobs' contents/packages/id-token permissions. Dependabot's github-actions updates keep SHA pins current. Refs #60 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent bd71de7 commit e36e1d6

3 files changed

Lines changed: 33 additions & 33 deletions

File tree

‎.github/workflows/codeql.yml‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ jobs:
2020

2121
steps:
2222
- name: Checkout repository
23-
uses: actions/checkout@v7
23+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
2424

2525
- name: Set up Go
26-
uses: actions/setup-go@v7
26+
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
2727
with:
2828
go-version-file: 'go.mod'
2929

3030
- name: Initialize CodeQL
31-
uses: github/codeql-action/init@v4
31+
uses: github/codeql-action/init@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4
3232
with:
3333
languages: go
3434
queries: security-extended
@@ -37,6 +37,6 @@ jobs:
3737
run: go build -buildvcs=false ./...
3838

3939
- name: Perform CodeQL Analysis
40-
uses: github/codeql-action/analyze@v4
40+
uses: github/codeql-action/analyze@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2 # v4
4141
with:
4242
category: "/language:go"

‎.github/workflows/go.yml‎

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -21,27 +21,27 @@ jobs:
2121
go: [ minimum, stable ]
2222

2323
steps:
24-
- uses: actions/checkout@v7
24+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
2525
with:
2626
fetch-depth: 0
2727

2828
- name: Set up Go (go.mod minimum)
2929
if: matrix.go == 'minimum'
30-
uses: actions/setup-go@v7
30+
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
3131
with:
3232
go-version-file: 'go.mod'
3333
cache: false
3434

3535
- name: Set up Go (latest stable)
3636
if: matrix.go == 'stable'
37-
uses: actions/setup-go@v7
37+
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
3838
with:
3939
go-version: stable
4040
check-latest: true
4141
cache: false
4242

4343
- name: Cache Go build artifacts
44-
uses: actions/cache@v6
44+
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6
4545
with:
4646
path: |
4747
~/.cache/go-build
@@ -73,7 +73,7 @@ jobs:
7373
# new as the toolchain it analyses (v2.12 could not type-check Go 1.27).
7474
- name: Run golangci-lint
7575
if: matrix.go == 'stable'
76-
uses: golangci/golangci-lint-action@v9
76+
uses: golangci/golangci-lint-action@ba0d7d2ec06a0ea1cb5fa41b2e4a3ab91d21278a # v9
7777
with:
7878
version: v2.14.0
7979

@@ -91,13 +91,13 @@ jobs:
9191
contents: read
9292

9393
steps:
94-
- uses: actions/checkout@v7
94+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
9595

9696
- name: Set up Docker Buildx
97-
uses: docker/setup-buildx-action@v4
97+
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
9898

9999
- name: Build image (no push)
100-
uses: docker/build-push-action@v7
100+
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7
101101
with:
102102
context: .
103103
platforms: linux/amd64,linux/arm64
@@ -115,22 +115,22 @@ jobs:
115115
contents: read
116116

117117
steps:
118-
- uses: actions/checkout@v7
118+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
119119
with:
120120
fetch-depth: 0
121121

122122
- name: Set up Go
123-
uses: actions/setup-go@v7
123+
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
124124
with:
125125
go-version: stable
126126
check-latest: true
127127
cache: false
128128

129129
- name: Install syft (SBOMs)
130-
uses: anchore/sbom-action/download-syft@v0.24.3
130+
uses: anchore/sbom-action/download-syft@66cbf4bc1f1c0d2edc94016e65bc221b6bb0ad6c # v0.24.3
131131

132132
- name: GoReleaser snapshot
133-
uses: goreleaser/goreleaser-action@v7.2.3
133+
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
134134
with:
135135
version: "~> v2"
136136
args: release --snapshot --clean --skip=sign
@@ -160,32 +160,32 @@ jobs:
160160
attestations: write
161161

162162
steps:
163-
- uses: actions/checkout@v7
163+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
164164
with:
165165
fetch-depth: 0
166166

167167
# Release binaries use the latest stable Go so they ship a patched
168168
# standard library; go.mod's version is only the minimum (#38). No build
169169
# cache here, so release artifacts are always built from scratch.
170170
- name: Set up Go
171-
uses: actions/setup-go@v7
171+
uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7
172172
with:
173173
go-version: stable
174174
check-latest: true
175175
cache: false
176176

177177
- name: Install syft (SBOMs)
178-
uses: anchore/sbom-action/download-syft@v0.24.3
178+
uses: anchore/sbom-action/download-syft@66cbf4bc1f1c0d2edc94016e65bc221b6bb0ad6c # v0.24.3
179179

180180
- name: Install cosign (keyless signing)
181-
uses: sigstore/cosign-installer@v4.1.2
181+
uses: sigstore/cosign-installer@6f9f17788090df1f26f669e9d70d6ae9567deba6 # v4.1.2
182182

183183
- name: Release notes from CHANGELOG.md
184184
shell: bash
185185
run: .github/scripts/release-notes.sh "${GITHUB_REF_NAME}" > "${RUNNER_TEMP}/notes.md"
186186

187187
- name: GoReleaser
188-
uses: goreleaser/goreleaser-action@v7.2.3
188+
uses: goreleaser/goreleaser-action@f06c13b6b1a9625abc9e6e439d9c05a8f2190e94 # v7.2.3
189189
with:
190190
version: "~> v2"
191191
args: release --clean --release-notes=${{ runner.temp }}/notes.md
@@ -201,7 +201,7 @@ jobs:
201201
done
202202
203203
- name: Attest build provenance
204-
uses: actions/attest-build-provenance@v4
204+
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4
205205
with:
206206
subject-path: |
207207
dist/*.tar.gz
@@ -229,7 +229,7 @@ jobs:
229229
attestations: write
230230

231231
steps:
232-
- uses: actions/checkout@v7
232+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
233233

234234
# GHCR requires lowercase repository names; the owner is mixed case.
235235
- name: Compute image name
@@ -240,18 +240,18 @@ jobs:
240240
run: echo "name=ghcr.io/${OWNER,,}/subenum" >> "$GITHUB_OUTPUT"
241241

242242
- name: Set up Docker Buildx
243-
uses: docker/setup-buildx-action@v4
243+
uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4
244244

245245
- name: Log in to GHCR
246-
uses: docker/login-action@v4
246+
uses: docker/login-action@dbcb813823bdd20940b903addbd779551569679f # v4
247247
with:
248248
registry: ghcr.io
249249
username: ${{ github.actor }}
250250
password: ${{ secrets.GITHUB_TOKEN }}
251251

252252
- name: Image metadata
253253
id: meta
254-
uses: docker/metadata-action@v6
254+
uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6
255255
with:
256256
images: ${{ steps.image.outputs.name }}
257257
tags: |
@@ -261,7 +261,7 @@ jobs:
261261
262262
- name: Build and push
263263
id: push
264-
uses: docker/build-push-action@v7
264+
uses: docker/build-push-action@c3c9e263c25d99ce0380d002d59b67737d91b0dc # v7
265265
with:
266266
context: .
267267
platforms: linux/amd64,linux/arm64
@@ -271,7 +271,7 @@ jobs:
271271
build-args: VERSION=${{ github.ref_name }}
272272

273273
- name: Attest image provenance
274-
uses: actions/attest-build-provenance@v4
274+
uses: actions/attest-build-provenance@4d101475d8b20a2381f78447822ac1eab6504dd8 # v4
275275
with:
276276
subject-name: ${{ steps.image.outputs.name }}
277277
subject-digest: ${{ steps.push.outputs.digest }}

‎.github/workflows/pages.yml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ jobs:
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: Checkout
23-
uses: actions/checkout@v7
23+
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
2424
- name: Setup Pages
25-
uses: actions/configure-pages@v6
25+
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6
2626
- name: Build with Jekyll
27-
uses: actions/jekyll-build-pages@v1
27+
uses: actions/jekyll-build-pages@44a6e6beabd48582f863aeeb6cb2151cc1716697 # v1
2828
with:
2929
source: ./docs
3030
destination: ./_site
3131
- name: Upload artifact
32-
uses: actions/upload-pages-artifact@v5
32+
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5
3333
with:
3434
path: ./_site
3535

@@ -42,4 +42,4 @@ jobs:
4242
steps:
4343
- name: Deploy to GitHub Pages
4444
id: deployment
45-
uses: actions/deploy-pages@v5
45+
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5

0 commit comments

Comments
 (0)