Skip to content

ci(release): attest build provenance for release artifacts#11441

Merged
zkochan merged 1 commit into
mainfrom
ci/attest-build-provenance
May 4, 2026
Merged

ci(release): attest build provenance for release artifacts#11441
zkochan merged 1 commit into
mainfrom
ci/attest-build-provenance

Conversation

@zkochan

@zkochan zkochan commented May 4, 2026

Copy link
Copy Markdown
Member

Summary

Generate Sigstore-backed SLSA build provenance for the per-platform binary archives produced by pn copy-artifacts, using actions/attest-build-provenance. Users can then verify with gh attestation verify that the binaries attached to a GitHub Release were actually produced by this repo's release workflow rather than uploaded manually.

gh attestation verify pnpm-linux-x64.tar.gz \
    --repo pnpm/pnpm \
    --predicate-type https://slsa.dev/provenance/v1

Why this is not redundant with the existing release attestation

GitHub already auto-generates a release attestation (predicate type https://in-toto.io/attestation/release/v0.2) for every release in this repo, e.g. for v11.0.4. That attestation only proves which file digests were attached to a tag in this repo. It does not prove how those files were built — anyone with release-write permission (a leaked PAT, a malicious workflow) can attach arbitrary binaries to a release, and GitHub will dutifully sign a release attestation for them.

The new build-provenance attestation uses predicate type https://slsa.dev/provenance/v1 and binds each artifact's digest to:

  • the exact workflow file (.github/workflows/release.yml) and commit SHA that built it,
  • the GitHub-hosted runner identity,
  • the workflow run ID.

The two attestations are complementary, not duplicates: release proves "where the file was hosted," build provenance proves "how the file was built."

The pn release step already publishes the npm tarballs with --provenance, so this closes the same gap on the GitHub Release side.

Implementation notes

  • attestations: write permission added to the release job alongside the existing id-token: write (already present for npm OIDC).
  • The attest step runs after Copy Artifacts (so dist/* exists) and before Release (so the digests being signed match what gets uploaded).
  • The action is pinned to its v4.1.0 SHA to match the convention used by the other actions in this workflow.

Test plan

  • Cut a pre-release tag from a branch off this PR and verify gh attestation verify <artifact> --repo pnpm/pnpm --predicate-type https://slsa.dev/provenance/v1 succeeds for each pnpm-* archive and source-maps.tgz.
  • Confirm both predicate types (slsa.dev/provenance/v1 and in-toto.io/attestation/release/v0.2) are visible in the release's attestations API.

Summary by CodeRabbit

  • Chores
    • Enhanced release process with build provenance attestation to improve build integrity verification and transparency.

Generate Sigstore-backed SLSA build provenance for the platform tarballs
and zips produced by `pn copy-artifacts` via actions/attest-build-provenance,
so users can verify with `gh attestation verify` that the binaries attached
to a GitHub release came from this repository's release workflow rather
than from a manual upload.

This complements the release attestation that GitHub auto-generates for
Releases (predicate `https://in-toto.io/attestation/release/v0.2`), which
only proves what files were attached to a tag, not how they were built.
The new attestation uses `https://slsa.dev/provenance/v1` and binds each
artifact's digest to the workflow_ref, commit SHA, and runner identity.

The `pn release` step already publishes npm tarballs with provenance, so
this closes the same gap on the GitHub Release side.
Copilot AI review requested due to automatic review settings May 4, 2026 10:59
@coderabbitai

coderabbitai Bot commented May 4, 2026

Copy link
Copy Markdown

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a853e4d7-ea5b-4bdc-992a-183f1db98ac5

📥 Commits

Reviewing files that changed from the base of the PR and between 7b9c459 and a74ea99.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

📝 Walkthrough

Walkthrough

The release workflow is extended to support build provenance attestation. A new permission attestations: write is added to the release job, and a new step using actions/attest-build-provenance is introduced to attest the built artifacts in the dist/ directory.

Changes

Build Provenance Attestation

Layer / File(s) Summary
Job Permissions
.github/workflows/release.yml
The release job gains attestations: write permission to enable build provenance attestation.
Attestation Step
.github/workflows/release.yml
A new "Attest build provenance" step using actions/attest-build-provenance is added to attest all files in dist/*.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 Build provenance now assured and blessed,
Our artifacts wear their attestation vest,
A rabbit's hop through cryptographic cheer,
Trust sealed with each release held dear! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and accurately describes the main change: adding build provenance attestation for release artifacts in the CI workflow.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ci/attest-build-provenance

Review rate limit: 9/10 reviews remaining, refill in 6 minutes.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the release workflow by generating Sigstore-backed SLSA v1.0 build provenance attestations for the per-platform binary archives produced during pn copy-artifacts, enabling downstream users to verify that GitHub Release assets were built by this repository’s release workflow.

Changes:

  • Add attestations: write permission to the release job to allow publishing provenance attestations.
  • Add an actions/attest-build-provenance step to attest all files produced under dist/* before uploading them to the GitHub Release.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@zkochan zkochan merged commit caf5b7d into main May 4, 2026
14 checks passed
@zkochan zkochan deleted the ci/attest-build-provenance branch May 4, 2026 11:09
zkochan added a commit that referenced this pull request May 4, 2026
Generate Sigstore-backed SLSA build provenance for the platform tarballs
and zips produced by `pn copy-artifacts` via actions/attest-build-provenance,
so users can verify with `gh attestation verify` that the binaries attached
to a GitHub release came from this repository's release workflow rather
than from a manual upload.

This complements the release attestation that GitHub auto-generates for
Releases (predicate `https://in-toto.io/attestation/release/v0.2`), which
only proves what files were attached to a tag, not how they were built.
The new attestation uses `https://slsa.dev/provenance/v1` and binds each
artifact's digest to the workflow_ref, commit SHA, and runner identity.

The `pn release` step already publishes npm tarballs with provenance, so
this closes the same gap on the GitHub Release side.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants