ci(release): restore OIDC auth, keep the idempotency guard (security fix)#569
Merged
Merged
Conversation
PR #567 pivoted to stored-token auth (`secrets.PYPI_API_TOKEN`) to get the `pypi` Deployments widget green. That was a security downgrade — OIDC Trusted Publishing is strictly better (no long-lived token stored anywhere; PyPI verifies a short-lived per-run identity at upload time). This restores OIDC as the publish credential, while keeping the idempotency guard introduced in #567 — which is the part that actually turns the widget green for already-published versions (the guard hits the public PyPI JSON endpoint and needs no auth at all). End state: - No GitHub Secret required. - Already-published versions (1.0.0, 1.0.1) → workflow detects them and skips the upload → deployment goes green without ever attempting OIDC. - Fresh versions → workflow attempts OIDC; will still red-X until the one-time PyPI Trusted Publisher is configured (#564). When that's done the workflow's fresh-upload path also goes green, with no token stored anywhere on the repo or on disk. Closes #568 (the "add stored secret" follow-up is moot — there is no stored secret to add). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 28, 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.
What
Revert the auth method from PR #567 (stored token in repo secrets) back to OIDC Trusted Publishing, while keeping the idempotency guard that PR introduced.
Why
PR #567 changed the publish credential from OIDC to a stored `PYPI_API_TOKEN` repo secret. That's a security downgrade:
PyPI explicitly recommends Trusted Publishing for exactly this reason. Sticking with OIDC keeps zero long-lived secrets on disk or in GitHub Secrets.
What I kept from #567
The idempotency guard — the step that queries `pypi.org/pypi///json` before uploading. This is what actually fixes the red `pypi` Deployment widget for already-published versions:
End state
Closes
Diff
`.github/workflows/release.yml` — pivot the auth back to OIDC; idempotency guard stays exactly as #567 wrote it.
🤖 Generated with Claude Code