Repository navigation
Restore the tag object before checking that it is annotated - #37
Merged
Merged
Conversation
The annotated-tag guard failed v0.5.0, which is annotated on the remote: `refs/tags/v0.5.0` is a tag object dereferencing to 48f2266, the same shape as v0.4.0. `actions/checkout` is what makes it look lightweight. For a tag push it fetches the commit SHA *into* the tag ref -- `+<sha>:refs/tags/<name>` -- so the runner's checkout holds a lightweight tag regardless of what the remote carries. `git cat-file -t` then reports `commit` and the guard refuses. Reproduced against this repository: fetching `+48f2266:refs/tags/v0.5.0` yields `commit`, and `%(contents)` returns "Cut 0.5.0 (#36)" -- the squash commit's subject. That is exactly the failure the guard exists to prevent, so it was right to stop; it was reading a ref the checkout had replaced. Re-fetching `refs/tags/<name>` restores the tag object. Verified on the same clone: the type becomes `tag` and `%(contents)` returns the release notes. The guard stays as it is. It is the only reason a commit subject did not ship as the 0.5.0 release notes. Note that a tag push runs the workflow from the tagged commit, so v0.5.0 has to be retagged once this is on main. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AnfKKSA7RyCwvsWhzyZ8zj
This was referenced Sep 16, 2026
Merged
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.
The
v0.5.0release run failed with "v0.5.0 is a lightweight tag". The tag is not lightweight — the guard was reading a refactions/checkouthad replaced.The tag is annotated
A tag object dereferencing to
48f2266— the same shape asv0.4.0. A lightweight tag has no^{}line.What the runner sees instead
For a tag push,
actions/checkoutfetches the commit SHA into the tag ref —+<sha>:refs/tags/<name>— so the checkout holds a lightweight tag whatever the remote carries. Reproduced against this repository:%(contents)returns the squash commit's subject. That is precisely the failure the guard was written for, so it was right to stop — it just attributed the cause to the tag rather than to the checkout.The fix
Re-fetch the tag ref before the check. Verified on the same clone:
The guard itself is unchanged. It is the only reason a commit subject did not ship as the 0.5.0 release notes, and it should keep failing a genuinely lightweight tag.
Retagging is required
A tag push runs the workflow from the tagged commit, so
v0.5.0still carries the old file and re-running its job will fail the same way. Once this is onmain:Nothing was published, so deleting the tag costs nothing — the run failed at the first step, before the build and well before the PyPI upload. That ordering was deliberate.
🤖 Generated with Claude Code
https://claude.ai/code/session_01AnfKKSA7RyCwvsWhzyZ8zj
Generated by Claude Code