Split workflow to reduce the available permissions during the build step#243
Merged
kevinbackhouse merged 2 commits intoMay 19, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the TestPyPI publishing GitHub Actions workflow to follow the “build in a low-permission job, publish in an OIDC-privileged job” pattern, reducing the blast radius of the build step.
Changes:
- Split the workflow into separate
buildandpublishjobs, moving OIDC + attestation permissions to the publish job. - Upload
dist/artifacts from the build job and download them in the publish job for publishing/attestation. - Update the build job’s Python version to 3.14.
Show a summary per file
| File | Description |
|---|---|
.github/workflows/publish-to-testpypi.yaml |
Splits build vs publish into separate jobs and relocates OIDC/attestation permissions to the publishing job. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 1/1 changed files
- Comments generated: 1
Comment on lines
+54
to
+57
| publish: | ||
| name: Publish to TestPyPI | ||
| needs: build | ||
| runs-on: ubuntu-latest |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| RELEASE_NAME: ${{ steps.create_version_number.outputs.RELEASE_NAME }} | ||
| RELEASE_NAME: ${{ needs.build.outputs.release_name }} | ||
| run: gh release create $RELEASE_NAME dist/* --repo $GITHUB_REPO --prerelease --generate-notes |
Comment on lines
+69
to
+72
| permissions: | ||
| contents: write | ||
| id-token: write # For trusted publishing | ||
| attestations: write # For artifact attestation |
p-
approved these changes
May 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes: #228 (but testing it on the TestPyPI workflow first)
I don't like what @copilot did in #230. It randomly downgraded some of the actions that're used and it also deleted the attestation step. So I'm doing it manually, so that I have higher confidence that the steps were only moved, not changed.
One change that I've made here that I'm unsure about is that the order of uploading artifacts and provenance attestation is swapped. I need to do that so that the attestation is done in the second job. Hopefully it'll still work.