Skip to content

Commit 39058e3

Browse files
bloveclaude
andauthored
ci(slsa): make release-provenance dispatchable + upload-tag-name (#706)
Adds workflow_dispatch(tag) and passes upload-tag-name to the SLSA generator so the attestation uploads to the right release regardless of github.ref. This lets the flow be verified by dispatching against an existing tag (e.g. v0.0.50) from main — without blind-firing a real release, and sidestepping the tag-commit-binding that made earlier fixes untestable. Also pins the build to the tag's code (checkout ref) so the tarballs match what shipped. Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 51f631a commit 39058e3

1 file changed

Lines changed: 22 additions & 1 deletion

File tree

.github/workflows/release-provenance.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,22 @@
11
name: Release provenance (SLSA)
22

3+
# Attaches npm-pack tarballs + a signed SLSA provenance (*.intoto.jsonl) to a
4+
# GitHub Release so OSSF Scorecard's Signed-Releases check can verify them.
5+
# Runs automatically on a published release, and can be dispatched manually
6+
# against an existing tag. `upload-tag-name` lets the dispatch path upload to
7+
# the right release even though github.ref is a branch, not the tag — which
8+
# also sidesteps the "release events run the workflow from the tag commit"
9+
# trap (a fix on main can be exercised by dispatching it against an old tag).
10+
311
on:
412
release:
513
types: [published]
14+
workflow_dispatch:
15+
inputs:
16+
tag:
17+
description: "Existing release tag to attest (e.g. v0.0.50)"
18+
required: true
19+
type: string
620

721
permissions:
822
contents: read
@@ -17,10 +31,16 @@ jobs:
1731
contents: write # gh release upload attaches tarballs to the release
1832
outputs:
1933
hashes: ${{ steps.hash.outputs.hashes }}
34+
tag: ${{ steps.tag.outputs.tag }}
2035
env:
2136
NPM_PUBLISHABLE_PROJECTS: chat,langgraph,ag-ui,render,a2ui,licensing,telemetry
2237
steps:
38+
- name: Resolve target tag
39+
id: tag
40+
run: echo "tag=${{ github.event.release.tag_name || inputs.tag }}" >> "$GITHUB_OUTPUT"
2341
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
42+
with:
43+
ref: ${{ steps.tag.outputs.tag }}
2444
- uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
2545
with:
2646
node-version: 24
@@ -44,7 +64,7 @@ jobs:
4464
- name: Upload tarballs to the release
4565
env:
4666
GH_TOKEN: ${{ github.token }}
47-
run: gh release upload "${{ github.event.release.tag_name }}" --clobber -- release-artifacts/*.tgz
67+
run: gh release upload "${{ steps.tag.outputs.tag }}" --clobber -- release-artifacts/*.tgz
4868

4969
provenance:
5070
needs: [build-artifacts]
@@ -56,3 +76,4 @@ jobs:
5676
with:
5777
base64-subjects: ${{ needs.build-artifacts.outputs.hashes }}
5878
upload-assets: true
79+
upload-tag-name: ${{ needs.build-artifacts.outputs.tag }}

0 commit comments

Comments
 (0)