Repository navigation
Publish to PyPI with trusted publishing - #340
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>
anth-volk
marked this pull request as ready for review
October 12, 2026 14:15
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: contents: write+id-token: write. No change needed.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 1.5.11 to 1.5.12. I checked this by runninginfer_bumpfrom the script on the branch (it returnspatch) andtowncrier build --draft.Note:
changelog.d/onmainalready has two leftover.yamlfiles (fix-copy-performance.yaml,migrate-to-app-token.yaml). towncrier doesn't use them, and the bump script counts them as patch, so they don't change the bump. I left them alone.Before merging
Add a trusted publisher to the PyPI project
microdf-python(Manage, then Publishing):PolicyEnginemicrodfversioning.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