Repository navigation
feat(publishing): attach SLSA build provenance (.intoto.jsonl) to releases - #268
Conversation
…eases Scorecard's Signed-Releases check credits the provenance tier (10) only for a .intoto.jsonl asset -- a .sigstore.json bundle lands at the signature tier (8) at best. Add a genuine SLSA3 provenance file covering the published tarball(s) to the release so consuming repos reach 10 via @v4. - New `provenance-subjects` job: from the same build artifact, re-packs the core package (and any satellites, via discover-subpackages) with a pinned Node so the tarballs are byte-identical to the published ones, then emits base64 sha256 subjects. - New `provenance` job: calls slsa-framework/slsa-github-generator [email protected] (must be a full @vX.Y.Z tag) with those subjects, uploading the .intoto.jsonl to the core release (v<version>). Gated to real, public, non-source-only releases that actually shipped a new version: private repos are skipped (SLSA records the repo+tag in the public Rekor log -- opting in would need private-repository:true), and dry-runs / source-only releases carry no tarball. actions:read is added to the workflow-level permission ceiling so the provenance job can request it. Not dry-run-provable (per issue #243): needs a live test release to confirm the .intoto.jsonl attaches and Scorecard reports Signed-Releases: 10. continue-on-error is on for first rollout so a wiring hiccup can't red an otherwise-successful release; flip to false once validated. Prereq: the org's allowed actions/reusable-workflows policy must permit slsa-framework/*. Fixes #243
There was a problem hiding this comment.
🟡 Changes recommended
The provenance reusable-workflow call passes continue-on-error as a with: input (instead of a job-level key), which should fail workflow validation.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
Adds SLSA build provenance generation to the reusable publishing workflow so that public, non–dry-run releases attach a .intoto.jsonl provenance asset to the GitHub Release.
Changes:
- Grant workflow-level
actions: readto allow a downstream provenance job to request it. - Add a job to re-pack release tarballs from the build artifact and compute SLSA subjects.
- Add a job that invokes
slsa-framework/slsa-github-generatorto generate and upload.intoto.jsonlprovenance to the release tag.
File summaries
| File | Description |
|---|---|
| .github/workflows/reusable-publishing.yml | Adds SLSA provenance subject computation + generator invocation, plus required workflow permissions. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…ublished workflow The inline SLSA provenance in reusable-publishing.yml was invalid: the generator job passed `continue-on-error: true` under `with:`, an undeclared input to the reusable `generator_generic_slsa3.yml` that fails workflow validation. It can't be fixed by moving `continue-on-error` to the job level either — that keyword is not supported on a reusable-workflow-calling job. And the job is a leaf, so a downstream `if: always()` can't keep its failure from reddening the release run. The generator being a reusable-workflow call is exactly why it can't be made non-blocking inside the publish run. So move it out: remove the two inline jobs (and the workflow-level `actions: read` they needed) from reusable-publishing.yml, and add reusable-provenance.yml on its own `release: published` trigger, where a provenance failure lands in a separate run and never affects the release's conclusion. The decoupled subjects job re-packs the SAME build artifact the publish run uploaded — looked up by name via the Actions API (a different run, so actions/download-artifact can't reach it) — keeping the signed subjects byte-identical to what was published; the pack/subjects logic is otherwise unchanged from the inline version. A source-only release (no artifact) skips cleanly. Adds the consumer example caller under security/. Live validation (issue #243/#268) still pending: the API artifact fetch, the nested generator call, and the .intoto.jsonl upload aren't dry-run-provable and need a real package release to confirm. The org allowed-actions policy must permit slsa-framework/*. Addresses Copilot review on PR #268.
There was a problem hiding this comment.
🟡 Changes recommended
The reusable provenance workflow currently selects build artifacts by a stable name and per_page=1, which can attach provenance for the wrong release build or fail instead of skipping cleanly.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
Addressing Copilot review on #268: the build-artifact name (e.g. build-artifacts-lts) is stable across releases, so looking it up by name with per_page=1 could attach provenance for a NEWER release's build. And the download step's set -euo pipefail hard-failed the job on any transient gh api error, contradicting the documented best-effort/skip-cleanly behavior. Now select the newest un-expired artifact whose workflow_run.head_sha matches the checked-out tag commit (git rev-parse HEAD), and fail OPEN: any gh lookup/ download/unzip error, or no matching artifact, sets found=false and skips provenance instead of failing the run.
There was a problem hiding this comment.
🔵 Needs a closer look
The reusable workflow exposes a configurable runner input but relies on GNU/Linux-specific tooling/flags, so it should either document the constraint explicitly or make the subject encoding step more portable to avoid surprising runtime failures.
Review details
Suppressed comments (2)
Previously missed (1) — in code that hasn't changed since the last review.
.github/workflows/reusable-provenance.yml:58
runs_onaccepts an arbitrary runner label, but this workflow assumes a Linux/GNU userland (bash, gh, jq, unzip, sha256sum, GNU base64 flags). If callers overrideruns_onto macOS/Windows/self-hosted images without these tools, the subjects step will fail in non-obvious ways. Consider tightening the input description to document the Linux/GNU requirement (or explicitly constrain supported runners).
This issue also appears on line 172 of the same file.
.github/workflows/reusable-provenance.yml:175
base64 -w0is GNU-specific; if this runs on a non-GNU base64 implementation (possible ifruns_onis overridden), the subjects encoding will fail and provenance will be skipped. Using a portable base64 invocation (and stripping newlines) keeps the encoding single-line without relying on GNU flags.
echo "🔏 Provenance subjects:"
sha256sum ./*.tgz
hashes=$(sha256sum ./*.tgz | base64 -w0)
echo "hashes=$hashes" >> "$GITHUB_OUTPUT"
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
…mption Addressing Copilot suppressed findings on #268: replace GNU-only `base64 -w0` with `base64 | tr -d '\n'` so the single-line subject encoding doesn't depend on a GNU userland, and note in the runs_on input description that the subjects job requires a Linux/GNU runner (bash, gh, jq, unzip, sha256sum).
|
Addressed the round-3 suppressed findings (portability), fixed in |
There was a problem hiding this comment.
🟢 Approval recommended
The workflows are internally consistent, follow the intended “decouple provenance from publishing” design, and the generator inputs/subject formatting align with the referenced SLSA generator contract.
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0 new
- Review effort level: Lite
🚀 What's Changed
💥 Breaking Changes
No breaking changes
✨ Features
🐛 Bug Fixes
📦 Dependencies
No dependency updates
🔧 Other Changes
👥 Contributors