feat: add SLSA provenance attestations to publish workflow#2238
Conversation
Up to standards ✅🟢 Issues
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughThe publish workflow is extended to generate and publish build provenance attestations for distribution artifacts (wheels and source distributions) alongside existing Sigstore signatures, addressing supply-chain integrity concerns. ChangesBuild Provenance Attestations
sequenceDiagram
participant Runner as GitHub Actions runner
participant PublishJob as publish-and-sign job
participant ActionsAttest as actions/attest
participant PyPIPublish as pypa/gh-action-pypi-publish
participant PyPI as PyPI registry
Runner->>PublishJob: start publish-and-sign job
PublishJob->>ActionsAttest: Generate build provenance for dist/*.whl, dist/*.tar.gz
ActionsAttest->>PublishJob: return provenance attestations
PublishJob->>PyPIPublish: invoke publish step with attestations: true
PyPIPublish->>PyPI: upload package and attach attestations
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. 📋 Issue PlannerBuilt with CodeRabbit's Coding Plans for faster development and fewer bugs. View plan used: ✨ 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 |
|
Hello, this is the OfficeHourBot. This is a reminder that the Hiero Python SDK Office Hours are scheduled in approximately 4 hours (14:00 UTC). This session provides an opportunity to ask questions regarding this Pull Request. Details:
Disclaimer: This is an automated reminder. Please verify the schedule here for any changes. From, |
|
As of version 4, actions/attest-build-provenance is simply a wrapper on top of actions/attest. Existing applications may continue to use the attest-build-provenance action, but new implementations should use actions/attest instead. Please see the actions/attest repository for usage information. |
- Add attestations: write permission to publish-and-sign job - Add actions/attest step for wheel and sdist artifacts - Explicitly enable PEP 740 attestations in pypa/gh-action-pypi-publish Fixes hiero-ledger#2235 Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>
f768adf to
ebe8df6
Compare
|
Thanks for the review. I updated the workflow to use actions/attest directly instead of actions/attest-build-provenance, and kept it SHA-pinned following the existing workflow convention. |
There was a problem hiding this comment.
Pull request overview
This PR updates the release publishing workflow to generate and upload SLSA/in-toto provenance attestations for built Python artifacts, addressing verification warnings about missing provenance (Fixes #2235).
Changes:
- Adds
attestations: writepermission to thepublish-and-signjob. - Adds an attestation step intended to generate provenance for
dist/*.whlanddist/*.tar.gz. - Enables PyPI-side PEP 740 attestations via
pypa/gh-action-pypi-publish(attestations: true).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
exploreriii
left a comment
There was a problem hiding this comment.
Hi i was looking at the documentation
Some ideas - move attestation into right after build because that job creates dist/.whl and dist/.tar.gz; attesting there gives cleaner provenance. Add artifact-metadata: write there to due to the newer actions/attest permission expectations. After that, remove attestations: write from publish-and-sign because it no longer generates attestations.
Also please check if this would fail without artifact-metadata
https://github.com/actions/attest
and
"Add the following to your workflow after your artifact has been built:"
…sion Move actions/attest step from publish-and-sign to the build job where dist artifacts are created, giving cleaner provenance. Add id-token:write, attestations:write, and artifact-metadata:write permissions to the build job. Remove attestations:write from publish-and-sign as it no longer generates attestations. Signed-off-by: bhuvan-somisetty <somisettybhuvan5@gmail.com>
aceppaluni
left a comment
There was a problem hiding this comment.
@bhuvan-somisetty This is looking good. Thank you for adding this.
Happy to review again when changes are applied.
aceppaluni
left a comment
There was a problem hiding this comment.
Can you update your branch when you have a moment? From there we can run the workflows
aceppaluni
left a comment
There was a problem hiding this comment.
Can you update the branch again, thank you
|
Hi, this is WorkflowBot.
|
|
@bhuvan-somisetty, Thanks for the PR, Can you update the branch again |
|
👋 Hi @bhuvan-somisetty! Great work completing a Intermediate issue! 🎉 Thanks for your contribution! 🚀 🏆 Milestone unlocked: you've reached Advanced level! 🎉 Here are some issues you might want to explore next: 🌟 Stay connected: Happy coding! 🚀 |
Summary
Fixes #2235
Recent releases included Sigstore signatures but lacked SLSA/in-toto provenance attestations, causing verification tooling to warn that "release artifact does not have provenance". This PR resolves the supply-chain security gap.
Changes
All changes are confined to
.github/workflows/publish.yml:attestations: writepermission to thepublish-and-signjob so the workflow can upload provenance to GitHub's Attestations APIactions/attest-build-provenancestep after artifact download to generate SLSA provenance for both.whland.tar.gzartifacts (SHA-pinned following existing workflow conventions)attestations: trueinpypa/gh-action-pypi-publishto ensure PEP 740 attestations are uploaded to PyPI alongside the packageVerification
After merging, the next release can be verified with:
Test plan
gh attestation verifyreturns no warnings