fix: use version-sorted tags for release bump - #78
Merged
Merged
Conversation
git describe --tags --abbrev=0 finds the nearest tag reachable from HEAD by commit graph, which breaks when multiple tags point to the same commit (as happened with v0.0.20/v0.0.21, both on the same commit from a prior re-run). It picked the wrong one, computed a tag that already existed, and failed the release with "tag already exists". Sorting all v* tags by version and taking the highest always finds the true latest release regardless of commit history. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
The release workflow (`CreateRelease.yml`) failed on the develop->main merge for #77 with `fatal: tag 'v0.0.21' already exists`. Root cause: it used `git describe --tags --abbrev=0`, which finds the nearest tag by commit-graph reachability from HEAD. Two tags, `v0.0.20` and `v0.0.21`, both point at the same commit (leftover from a prior re-run), so `describe` returned the older-looking one, the bump logic recomputed `v0.0.21`, and tag creation failed since it already existed.
This switches to `git tag --list 'v*' --sort=-v:refname | head -n 1`, which finds the true highest existing version tag regardless of which commit it's attached to.
Test plan
🤖 Generated with Claude Code