Write the trusted-publisher registration down as the form it is typed into - #71
Merged
Merged
Conversation
… into The workflow header and the roadmap described the registration in prose. PyPI's Add a pending publisher form asks for five labelled fields, and Workflow name is the filename rather than the workflow's name: field, which is a mistake that surfaces as a permissions error rather than a typo. Both now carry the values verbatim. No workflow behaviour changes.
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 this is
An audit of this repository's publish path found nothing wrong with it.
publish-pypi.ymlis correct: dispatch-only; it refuses a tagrelease.ymlhas not turned into a published GitHub release; it verifies the tag object, its signature against.github/allowed_signers, and its ancestry onmain; it builds at the tagged commit and asserts the artefact filenames carry the tag's own version; and the publish job never checks the repository out, holdsid-token: writeandenvironment: pypiand nothing else, so publication is Trusted Publishing over OIDC with no long-lived token stored anywhere. The README is already honest: "The package is not on PyPI yet; apublish-pypiworkflow exists and runs only when the maintainer dispatches it."So this changes one thing only, and it is small: the single action standing between this project and an installable package is now written down as the form it has to be typed into.
What was wrong with it
The workflow header and
docs/ROADMAP.mdboth described the registration in prose — the project must be "registered on pypi.org with this repository, that workflow file and thepypienvironment named as its publisher." That is accurate, and it is not the five labelled fields PyPI's Add a pending publisher form asks for. It leaves the one person who can do it reconstructing a form from a sentence.One of those fields is a genuine trap.
Workflow nameis the filename (publish-pypi.yml), not the workflow'sname:field (publish-pypi). They happen to look alike here, which makes it worse rather than better: get it wrong and PyPI rejects the OIDC claim, and the failure reads as a permissions problem rather than as a typo.What changed
Workflow nameis the filename.pypi.org/pypi/ca-tariff-parse/json→ HTTP 404. It now also says what "free" means, which the earlier wording left implicit: free is not reserved. Nothing holds that name until the registration is made.No workflow behaviour changes. Nothing is published, tagged, or dispatched, and the workflow remains inert until you dispatch it.
Verification
make verify: green. 614 passed, 65 skipped, 93.89% coverage against an 85% floor.No negative control: the diff is three comment and prose blocks and adds no executable line. The workflow's own guards are unchanged and already covered by the repository's existing tests, and sabotaging a comment to watch a test not fail would prove nothing.
The values, so they are also here
pypi.org → Your projects → Publishing → Add a pending publisher (the project does not exist on PyPI yet). Afterwards,
gh workflow run publish-pypi.yml --ref main -f tag=v0.2.0publishes the existing signed release. Both steps are yours alone and neither is taken here.Deliberately not touched
The monetization plan's gates and the weekly
tariff-watchjob are outside this branch entirely; nothing here reads or changes either.Prepared with AI assistance; reviewed before submission.