Repository navigation
Publish to PyPI with trusted publishing - #221
Merged
Merged
Conversation
Run the PyPI upload in the pypi environment with an OIDC token instead of the shared org-wide PYPI API token, and add a patch changelog entry so merging cuts a release through the new path. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
anth-volk
marked this pull request as ready for review
October 12, 2026 14:21
This branch was successfully deployed
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.
Summary
Moves the PyPI upload in
.github/workflows/versioning.yamlfrom the shared org-widePYPIAPI token to PyPI trusted publishing (OIDC), and adds a patch changelog entry so merging this PR cuts a release through the new path.Changes to the
publish-to-pypijob:environment: pypi. Thepypienvironment already exists in this repo, limited tomain, so only runs onmaincan get a token PyPI will accept.permissions:withcontents: write(the job pushes the release tag via.github/publish-git-tag.sh, and job-level permissions replace the defaults) andid-token: write(needed to mint the OIDC token).user: __token__andpassword: ${{ secrets.PYPI }}frompypa/gh-action-pypi-publish. The action ignores OIDC while a password is passed.skip-existing: truestays.There are no other
secrets.PYPIuses in.github/.Release:
changelog.d/trusted-publishing.changed.md..github/bump_version.pymapschangedfragments to a patch bump (onlybreakingis major, and onlyadded/removedare minor), so merging bumps 3.1.3 to 3.1.4. I checked this by runninginfer_bumpfrom the script on the branch (it returnspatch) andtowncrier build --draft. TheChangelogPR check (towncrier check --compare-with origin/main) accepts the fragment.Before merging
Add a trusted publisher to the PyPI project
microimpute(Manage, then Publishing):PolicyEnginemicroimputeversioning.yamlpypiIf this merges before the publisher exists, the upload fails with
invalid-publisher. Add the publisher, then re-run the failedPublish to PyPIjob.skip-existingmakes the re-run safe.Test plan
actionlinton the changed workflow: no findings, same as before the changeUpdate package versionrun'sPublish to PyPIjob uploads the new patch version using OIDC, and the version shows up on PyPI🤖 Generated with Claude Code