Skip to content

fix: use version-sorted tags for release bump - #78

Merged
mikemadeja merged 1 commit into
developfrom
fix/release-tag-detection
Sep 18, 2026
Merged

mikemadeja merged 1 commit into
developfrom
fix/release-tag-detection

Conversation

@mikemadeja

Copy link
Copy Markdown
Owner

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

  • Ran `git tag --list 'v*' --sort=-v:refname | head -n 1` locally against this repo's tags — correctly returns `v0.0.21` (the true latest) instead of the value `git describe` picked
  • Confirmed by the next develop->main merge triggering a clean release

🤖 Generated with Claude Code

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>
@mikemadeja
mikemadeja merged commit 3b5e3c0 into develop Sep 18, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant