fix: attach SLSA provenance to draft release via gh release upload#713
Conversation
The slsa-github-generator (pinned at v2.1.0) attaches provenance using softprops/action-gh-release@v2.2.1, whose draft lookup reassigns the match on every page of releases instead of breaking on first hit. Once a repo crosses 100 releases (2 pages), the fresh draft on page 1 is clobbered by the empty page 2, the action falls through to createRelease(), and two drafts end up on the same tag. Set upload-assets: false so the generator no longer touches the release, and add a release-provenance job that downloads the provenance artifact and attaches it to goreleaser's single draft via 'gh release upload', which resolves the draft deterministically by tag.
|
Important Review skippedAuto incremental reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe CI workflow is updated to decouple SLSA binary provenance generation from release asset attachment. The ChangesSLSA Provenance Release Attachment Refactor
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related issues
Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Pull request overview
This PR adjusts the release/provenance publishing flow in the GitHub Actions pipeline to avoid slsa-github-generator’s release/draft mutation behavior (via softprops/action-gh-release) and instead attach the generated SLSA provenance to the existing GoReleaser-managed draft release deterministically by tag using gh release upload.
Changes:
- Disable SLSA generator release-asset uploading (
upload-assets: false) so it no longer modifies/releases drafts. - Add a
release-provenancejob to download the provenance workflow artifact and upload it to the draft release viagh release upload <tag> .... - Update
undraft-releaseto wait onrelease-provenancerather thanbinary-provenance.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
With upload-assets: false the generator's upload-assets job (the only one needing contents: write) is skipped, so contents: read suffices.
|
Known issue with it |

The slsa-github-generator (pinned at v2.1.0) attaches provenance using softprops/action-gh-release@v2.2.1, whose draft lookup reassigns the match on every page of releases instead of breaking on first hit. Once a repo crosses 100 releases (2 pages), the fresh draft on page 1 is clobbered by the empty page 2, the action falls through to createRelease(), and two drafts end up on the same tag.
Set upload-assets: false so the generator no longer touches the release, and add a release-provenance job that downloads the provenance artifact and attaches it to goreleaser's single draft via 'gh release upload', which resolves the draft deterministically by tag.
The issue was first found out in the openfga/openfga repo while attempting the same pipeline for immutable tagging
openfga/openfga#3178 (comment)
Description
What problem is being solved?
How is it being solved?
What changes are made to solve it?
References
Review Checklist
mainSummary by CodeRabbit