Publish to PyPI via Trusted Publishing (OIDC) - #67
Merged
Conversation
Replace the long-lived PYPI_API_TOKEN secret with PyPI Trusted Publishing. The release job now mints a short-lived OIDC token (id-token: write) that PyPI exchanges for an upload token, so there is no stored credential to leak, rotate, or expire. Requires a one-time Trusted Publisher config on PyPI (owner jedymatt, repo sqlalchemyseed, workflow python-publish.yml). The old account-scoped token should be revoked on PyPI and its GitHub secret removed. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
Replaces the long-lived
PYPI_API_TOKENsecret with PyPI Trusted Publishing (OIDC). Follow-up to the v2.1.0 revival — removes the 5-year-old account-scoped token as a credential to leak, rotate, or expire.What changed
python-publish.ymlnow runsuv publishwithpermissions: id-token: write; uv auto-detects the GitHub Actions OIDC credentials.pypa/gh-action-pypi-publishstep and thesecrets.PYPI_API_TOKENreference.Required before the next release (maintainer, one-time on PyPI)
jedymatt· Repository:sqlalchemyseed· Workflow:python-publish.yml· Environment: (blank)PYPI_API_TOKENGitHub secret (can be done viagh secret delete).Until step 1 is done, a release run would fail at the publish step — no data risk, just a failed upload.
🤖 Generated with Claude Code