Repository navigation
Description
What happens
The README is the long description PyPI shows, and #546 made pinning it a standing check. AGENTS.md asks every change to keep rev: on the released version, because a README that is wrong when the release is published "ships the old pin to PyPI, where it cannot be corrected without another release."
I read the rev: in the description of every release on PyPI. Of the 24 releases since #546, 11 name a different version:
| Release | rev: on its PyPI page |
|---|---|
| 2.18.1 | v2.18.0 |
| 2.18.2 | v2.18.1 |
| 2.18.3 | v2.18.2 |
| 2.19.1 | v2.19.0 |
| 2.19.2 | v2.19.0 |
| 2.19.3 | v2.19.2 |
| 2.19.5 | v2.19.4 |
| 2.20.0 | v2.19.5 |
| 2.20.1 | v2.21.0 |
| 2.21.0 | v2.20.5 |
| 2.22.0 | v2.21.1 |
The other 13 are right. 2.20.1 names a version that did not exist yet.
$ curl -s https://pypi.org/pypi/commit-check/2.22.0/json | python -c "import json,sys,re; print(re.findall(r'rev: (v\S+)', json.load(sys.stdin)['info']['description']))"
['v2.21.1']Why
The pin is a hand edit that has to land in a short window: after the version is known, before the release is published. The recent misses fall on both sides of it:
| Release | Pin PR | When it merged |
|---|---|---|
| 2.20.0 | #667 | 17 min after the release was published |
| 2.21.0 | #702 | 14 h after |
| 2.22.0 | #711 | 14 s after |
| 2.20.1 | #674 | 27 s before, but it pinned v2.21.0 and the release went out as v2.20.1; #676 fixed main, not PyPI |
Pinning ahead has a cost of its own, which #687 names: until the tag exists, pre-commit can't resolve the pin. main is in that state now: it pins v2.23.1, which has no tag or PyPI release yet.
Suggested fix
The publish job already builds from the tag, so it can write the tag into the README before it builds. setuptools-scm then has to be given the version, because the edited README makes the tree dirty and the wheel would otherwise build as 2.22.0.post1.dev0:
- name: Pin the README to this release
if: github.event_name == 'release'
env:
TAG: ${{ github.event.release.tag_name }}
run: |
python - <<'PY'
import os, pathlib, re
p = pathlib.Path("README.md")
p.write_text(re.sub(r"(rev:\s*)v\d+\.\d+\.\d+", rf"\g<1>{os.environ['TAG']}", p.read_text()))
PY
echo "SETUPTOOLS_SCM_PRETEND_VERSION_FOR_COMMIT_CHECK=${TAG#v}" >> "$GITHUB_ENV"It goes before Build wheel. Checked on v2.22.0 with the workflow's own pip wheel --no-deps -w dist .:
| Build | Version | rev: in the description |
|---|---|---|
| v2.22.0 as tagged | 2.22.0 | v2.21.1, what PyPI has |
| README stamped | 2.22.0.post1.dev0 | v2.22.0 |
| README stamped, version given | 2.22.0 | v2.22.0 |
The workflow_dispatch dry run to TestPyPI has no release tag, so the step is skipped there and nothing changes.
What it changes in AGENTS.md
The exception for pinning ahead of the tag can go, along with the check after publishing that #720 asks for: the job does both. The README on main would be bumped once the release exists, the same rule .pre-commit-config.yaml already follows, so it never names a tag that doesn't exist. A late bump then only leaves GitHub's README one release behind for a while. PyPI is right either way.
Happy to send the PR, with the AGENTS.md wording, if the direction seems right.
Activity
shenxianpeng commentedon Nov 20, 2026
Hi @invictustitan2 Thanks for bringing this up. Feel free to submit a PR. Thank you so much!
invictustitan2 commentedon Nov 20, 2026
Following up from #723, as promised there. Reading further for this turned up more than a pin, so I'm putting it here as a plan to discuss rather than a PR. Nothing in it needs to land at once, and parts of it touch how results reach each integration, which is yours to weigh.
One idea
The same commit with the same config should give the same verdict, and when it can't, the run should say what it ran against. Two inputs decide that: which commit-check version runs, and which policy is actually in force. Both have places today where they change without the result showing it.
The clearest example is already in the project's own tooling. On commit-check.com,
docs-synccaught a stale pin twice and the site deployed anyway: on 16 October and 22 October,test_pinned_revisions_match_the_released_versionfailed whilebuildanddeploysucceeded, becausedeployneeds onlybuild. The check was right; nothing downstream waited for it. Most of what follows has that shape.The version that runs
11 of the 24 releases since #546 put the wrong
rev:on PyPI. The same pin is written by hand in three repositories (heads of 20 November; hours measured from each pin's history onmainagainst PyPI's upload times):rev:, and PyPI's copy of itrev:docs-sync, which nothing waits for.githubprofile READMErev:pip install commit-check,commit-check-action@v2anduvx commit-check-mcpfloat on purpose. The Action already names the version it ran in its summary footer, which is what makes a floating form workable. One floating case gets an older release without saying so: commit-check-mcp still declares Python 3.10, wherecommit-check>=2.18.0resolves to 2.19.5, the last release before #662 (on 3.12 it gets 2.23.0).Checks for the pins, each reading only
rev:underrepo: https://github.com/commit-check/commit-check, each failure naming the file, the pin found, the pin expected, and where the bump is made:main: Release Drafter's action already outputs the draft'stag_name; with the org's reusable workflow passing it on, a follow-on job fails if the README names neither the latest release nor the draft's tag. That catches pinning v2.21.0 while preparing v2.20.1.publish.ymlcompares the tag's README with the event's tag beforeBuild wheel. The GitHub release is public by then; what this guarantees is that PyPI never gets the wrongrev:. Replayed against every release tag since docs: pin the README to v2.15.0, and make that a standing check #546, it fails the 11 and passes the other 13.scheduleto the current one would let a scheduled run deploy), and in every deploy run, withdeploywaiting for it..github: the same check for the profile README.Pinning ahead keeps the cost #687 names:
mainnamed a version not yet on PyPI for 18 h in total since #546, most of it the current v2.23.1.The policy that's in force
Here the CLI already tells the truth: each case below prints a notice. What I measured is where that notice ends up on the other faces (local fixtures at the 20 November heads of this repo, the Action and the MCP server; the first two rows give the same CLI and hook results at v2.23.0, the release a pinned hook runs):
resultinherit_fromthat can't load (missing file, 404, DNS, no network)⊘ … could not be loadedPassed; notice hiddenpass; notice only on server stderrsubject_max_lenght)⚠ unknown settingPassedpass; no noticefiles = "x"⊘ [files] must be a tablePassed[pull_request] ai_declaration_checkbox(singular)CCHK_SUBJECT_MAX_LENGTH=10pass(the server doesn't readCCHK_*)The hook column is pre-commit hiding a passing hook's output, as it does by design; with
verbose: trueevery notice shows. The network cases held 3 out of 3 runs on each face. Fail-open itself is documented and I'm not arguing against it; the point is that the user who depends on the org policy can't see from the result that it didn't load.The two cases that do reach the Action and the MCP result show the way:
ignore_authorsarrives in the Action's summary as a skip with its reason and in the MCP result asskip, andwarnas "passed with warnings" and awarncheck. Those travel in the result itself; the ones in the table are printed beside it. Carrying them in the result too (which parent loaded, at which ref, or that it didn't; which keys were ignored) would let each integration show them the way it already shows a skip. In the docs, "pin the branch" (@main) still moves; only a tag or a SHA pins what the policy says.A possible order
.githubchecks (4–5).CCHK_*gap, raised in that repository.I have the measurements behind every number here and can share any of them. Happy to take whichever parts you want, in whatever order suits you.
shenxianpeng commentedon Nov 20, 2026
Thanks, great write-up, and the numbers check out.
I'd rather keep the README in step with the release draft. Would you take this?
main: if the draft's tag differs from the commit-checkrev:in README.md, update that line on one fixed branch and open or update a single PR labeledskip-changelog. I'll merge it right before publishing, and I'll set up the token.publish.ymlbeforeBuild wheelthat fails if the pin doesn't match the release tag.Plus the matching AGENTS.md update. Pins in other repos I'll handle separately. The "policy in force" idea deserves its own issue; let's agree on the design there before any code.
invictustitan2 commentedon Nov 21, 2026
Thanks. It's in #726: the workflow, the
publish.ymlcheck and the AGENTS.md change. I'll open the policy-in-force issue separately.Two things bear on the token. The job rebuilds the fixed branch from
mainon each run, which is a force push to that one branch, because otherwiserequire_rebase_targetfails the pull request as soon asmainmoves. And it readsREADME_PIN_TOKENdirectly, so what fits as written is a fine-grained token limited to this repository, with contents and pull-requests write; a classic one would reach every repository you can write to. If you'd rather use a GitHub App, the job can mint its token withactions/create-github-app-tokeninstead, and I'll switch it.I ran it on my fork against real drafts and releases first, including a publish with the pin still unmerged; the runs are linked in the pull request.