This repository was archived by the owner on Oct 12, 2026. It is now read-only.
Repository navigation
Conversation
Replace the shared PYPI token with PyPI trusted publishing (OIDC): the Publish job now runs in the pypi environment with id-token: write (contents: write is kept for the git tag push), and no password is passed to pypa/gh-action-pypi-publish. Bump the version to 0.3.1 for the next patch release. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 of 4 tasks
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Warning
This would not work if pushed to
maintoday. ThePublishjob is skipped on every push (its commit-message gate can no longer be met), andmake installfails becausesetup.pypinspolicyengine-us==1.667.1, which is no longer on PyPI. Both are explained below; this PR stays a draft until they are resolved.Summary
Moves PyPI publishing from the shared org-wide
secrets.PYPItoken to PyPI trusted publishing (OIDC), and bumps the version for a patch release..github/workflows/push.yaml,Publishjob:environment: pypipermissions: { contents: write, id-token: write }.contents: writeis needed because.github/publish-git-tag.shpushes the version tag;id-token: writelets the action 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: trueis kept.setup.py: version0.3.0->0.3.1. PyPI's latest is0.3.0. Since the versioning job was removed inac40d1d, the repo bumps the version by hand insetup.py.The
pypiGitHub environment already exists in this repo, limited to themainbranch. No repo settings, environments or secrets are changed by this PR.There are two existing problems on
main. I left both alone because fixing them needs decisions beyond this migration:Publish,LintandTestinpush.yamlonly run whengithub.event.head_commit.message == 'Update reweight'. That commit used to come from theversioningjob, which was removed inac40d1d("Removed versioning", July 2024). Since then, no push tomaintriggers Publish. The last push run (Update GitHub Actions for Node 24 runtime #22, 2026-04-28) wasskipped. The0.3.0upload (2024-08-14) did not come from this workflow.make installcannot resolve.setup.pypinspolicyengine-us==1.667.1, and that version is no longer on PyPI. The job also uses Python 3.9, while currentpolicyengine-core/policyengine-ukneed>=3.11. Resolving locally on 3.9 gives:there is no version of policyengine-us==1.667.1. The PRTestjob only appears green because it hascontinue-on-error: true. Publishing0.3.1with that pin would also give users a package they can't install.To actually release, a maintainer needs to decide how to:
Publish, for example by gating ongithub.repositoryonlypolicyengine-uspin and the Python version, or drop the unneededmake installstep from PublishEither fix can go in this PR or in a follow-up.
Before merging
Add a trusted publisher on PyPI for the project
reweight(Manage project -> Publishing):PolicyEnginereweightpush.yamlpypiIf the Publish job runs before the publisher is added, the upload step fails with
invalid-publisher. Adding the publisher and re-running the failed job fixes it.Test plan
actionlintonpush.yaml: no findingspolicyengine-us==1.667.1is missing from PyPI (uv pip install --dry-run -e .[dev]on Python 3.9 fails)Publishjob onmainuploadsreweight 0.3.1🤖 Generated with Claude Code