Skip to content

Commit bae5749

Browse files
fix(ci): review GitHub Actions updates with the Publish fingerprint (#61)
Review setup-node 7.1.0, upload-artifact 7.0.2, and download-artifact 8.0.2 together with the corresponding Publish executable fingerprint. Preserve all release gates and reject unreviewed Action SHAs. Validated with npm ci, the complete npm run verify gate, independent workflow review, and exact-head CI.
1 parent a52c2fb commit bae5749

7 files changed

Lines changed: 47 additions & 21 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
with:
2828
persist-credentials: false
2929
- name: Set up Node.js 24
30-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
30+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
3131
with:
3232
node-version: 24.22.1
3333
cache: npm
@@ -77,7 +77,7 @@ jobs:
7777
fetch-depth: 0
7878
persist-credentials: false
7979
- name: Set up Node.js ${{ matrix.node-version }}
80-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
80+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
8181
with:
8282
node-version: ${{ matrix.node-version }}
8383
cache: npm
@@ -118,7 +118,7 @@ jobs:
118118
with:
119119
persist-credentials: false
120120
- name: Set up Node.js 24
121-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
121+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
122122
with:
123123
node-version: 24.22.1
124124
cache: npm
@@ -138,7 +138,7 @@ jobs:
138138
fi
139139
echo "sha256=$(sha256sum "${tarballs[0]}" | awk '{ print $1 }')" >> "$GITHUB_OUTPUT"
140140
- name: Upload the packed artifact
141-
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
141+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
142142
with:
143143
name: ci-npm-package
144144
path: ci-artifacts/*.tgz
@@ -152,7 +152,7 @@ jobs:
152152
timeout-minutes: 10
153153
steps:
154154
- name: Download the packed artifact by name
155-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
155+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
156156
with:
157157
name: ci-npm-package
158158
path: ci-artifacts
@@ -179,7 +179,7 @@ jobs:
179179
with:
180180
persist-credentials: false
181181
- name: Set up Node.js 22
182-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
182+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
183183
with:
184184
node-version: 22.23.4
185185
cache: npm
@@ -202,7 +202,7 @@ jobs:
202202
with:
203203
persist-credentials: false
204204
- name: Set up Node.js 24
205-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
205+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
206206
with:
207207
node-version: 24.22.1
208208
cache: npm
@@ -222,7 +222,7 @@ jobs:
222222
with:
223223
persist-credentials: false
224224
- name: Set up Node.js 26
225-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
225+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
226226
with:
227227
node-version: 26.12.1
228228
cache: npm
@@ -249,7 +249,7 @@ jobs:
249249
with:
250250
persist-credentials: false
251251
- name: Set up Node.js 24
252-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
252+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
253253
with:
254254
node-version: 24.22.1
255255
cache: npm

‎.github/workflows/live-smoke.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with:
3030
persist-credentials: false
3131
- name: Set up Node.js 24
32-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
32+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
3333
with:
3434
node-version: 24.22.1
3535
cache: npm

‎.github/workflows/publish.yml‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464
persist-credentials: false
6565
ref: ${{ github.event.workflow_run.head_sha }}
6666
- name: Set up Node.js 24
67-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
67+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
6868
with:
6969
node-version: 24.22.1
7070
cache: npm
@@ -107,7 +107,7 @@ jobs:
107107
run: npm ci --ignore-scripts
108108
- name: Download the exact Release Please result
109109
if: steps.result.outputs.has-result == 'true'
110-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
110+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
111111
with:
112112
name: release-please-result-${{ github.event.workflow_run.id }}-${{ github.event.workflow_run.run_attempt }}
113113
path: ${{ runner.temp }}/release-please-result
@@ -432,7 +432,7 @@ jobs:
432432
"repos/${GITHUB_REPOSITORY}/actions/runs/${SOURCE_RELEASE_RUN_ID}" \
433433
> "$SOURCE_RUN_FILE"
434434
- name: Download the exact Release Please result
435-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
435+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
436436
with:
437437
name: release-please-result-${{ env.SOURCE_RELEASE_RUN_ID }}-${{ env.SOURCE_RELEASE_RUN_ATTEMPT }}
438438
path: ${{ runner.temp }}/release-please-result
@@ -542,7 +542,7 @@ jobs:
542542
);
543543
EOF
544544
- name: Set up Node.js 24
545-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
545+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
546546
with:
547547
node-version: 24.22.1
548548
cache: npm
@@ -655,7 +655,7 @@ jobs:
655655
set -euo pipefail
656656
echo "name=npm-package-${{ steps.version.outputs.version }}-${{ github.run_id }}-${{ github.run_attempt }}" >> "$GITHUB_OUTPUT"
657657
- name: Upload the verified release artifact
658-
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
658+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
659659
with:
660660
name: ${{ steps.artifact-name.outputs.name }}
661661
path: ${{ steps.pack.outputs.tarball }}
@@ -693,7 +693,7 @@ jobs:
693693
persist-credentials: false
694694
ref: ${{ needs.verify.outputs.release-commit }}
695695
- name: Set up Node.js 24
696-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
696+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
697697
with:
698698
node-version: 24.22.1
699699
cache: npm
@@ -753,15 +753,15 @@ jobs:
753753
persist-credentials: false
754754
ref: ${{ needs.verify.outputs.release-commit }}
755755
- name: Set up Node.js 24
756-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
756+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
757757
with:
758758
node-version: 24.22.1
759759
package-manager-cache: false
760760
registry-url: https://registry.npmjs.org
761761
- name: Use a Trusted Publishing-capable npm CLI
762762
run: npm install --global npm@11.12.1
763763
- name: Download the verified release artifact
764-
uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
764+
uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
765765
with:
766766
name: ${{ needs.verify.outputs.artifact-name }}
767767
path: release-artifacts

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
exit 1
6363
fi
6464
- name: Set up Node.js 24
65-
uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
65+
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
6666
with:
6767
node-version: 24.22.1
6868
cache: npm
@@ -1205,7 +1205,7 @@ jobs:
12051205
EOF
12061206
- name: Upload the exact Release Please result
12071207
if: steps.preflight.outputs.mode == 'release'
1208-
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
1208+
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
12091209
with:
12101210
name: release-please-result-${{ github.run_id }}-${{ github.run_attempt }}
12111211
path: release-please-result/result.json

‎RELEASING.md‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,17 @@ Responses streams. It never contacts the production API.
182182
validate every workflow. It is not a GitHub Actions emulator and does not prove
183183
that any workflow executed remotely.
184184

185+
Action updates that touch `publish.yml` require a coordinated review of the
186+
upstream commits and the resulting executable workflow. After that review,
187+
update `PUBLISH_WORKFLOW_CONTRACT_SHA256` in
188+
`scripts/release-workflow-validation.mjs` in the same pull request as the action
189+
pins, then run `npm run verify`. The fingerprint is the SHA-256 of
190+
`JSON.stringify(parse(publishYaml))`, using the repository's `yaml` package.
191+
Dependabot cannot perform this review or update the fingerprint. Repeated
192+
rebases or reruns of an action-only pull request will therefore keep failing;
193+
finish the coordinated update before merging it. Preserve the negative tests
194+
for unreviewed action commits, permissions, gates, and publication commands.
195+
185196
## Version and dist-tag agreement
186197

187198
`package.json` is the sole candidate-version authority; validation must not

‎scripts/release-workflow-validation.mjs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const RELEASE_WORKFLOW_STEP = "Run Release Please";
1818
const PUBLISH_OPERATION = "release";
1919
const NPM_TAG_POLICY_ID = 55718965;
2020
const PUBLISH_WORKFLOW_CONTRACT_SHA256 =
21-
"379ba8678416ff96d3bcf220a23e8602d2b55890164b2847331def10b4e99693";
21+
"98910174abd3fc5a1d7e8c0cb64efb717960d54557e9799beea39a6228ef4bac";
2222
const PUBLISH_HANDOFF_IF =
2323
"vars.RELEASE_PLEASE_ENABLED == 'true' && github.event_name == 'workflow_run' && github.run_attempt == 1 && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.event == 'push' && github.event.workflow_run.head_branch == 'main'";
2424
const PUBLISH_RESULT_IF = "steps.result.outputs.has-result == 'true'";

‎tests/release-workflow-validation.test.mjs‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,21 @@ describe("Publish workflow dispatch contract", () => {
368368
});
369369
});
370370

371+
it.each([
372+
"actions/setup-node",
373+
"actions/upload-artifact",
374+
"actions/download-artifact",
375+
])("rejects an unreviewed %s commit", (action) => {
376+
const workflow = workflowContract();
377+
const step = Object.values(workflow.jobs)
378+
.flatMap((job) => job.steps)
379+
.find((candidate) => candidate.uses?.startsWith(`${action}@`));
380+
step.uses = `${action}@${"a".repeat(40)}`;
381+
expect(() => validatePublishWorkflowContract(workflow)).toThrow(
382+
/Publish executable definition digest/,
383+
);
384+
});
385+
371386
it.each([
372387
[
373388
"optional control input",

0 commit comments

Comments
 (0)