Skip to content

Determine the release tag by version, not commit date - #177

Merged
robredpath merged 1 commit into
masterfrom
fix-release-tag-sort
Aug 4, 2026
Merged

Determine the release tag by version, not commit date#177
robredpath merged 1 commit into
masterfrom
fix-release-tag-sort

Conversation

@robredpath

Copy link
Copy Markdown
Contributor

git rev-list --tags --max-count=1 returns the most recently committed tagged commit, which is not necessarily the highest version number:

tag commit date
v1.27 2026-04-23
v1.28 2026-04-10

So the old logic picked v1.27 and computed a next tag of v1.28 — which already existed. Yesterday's release run did exactly this.

Because a draft release doesn't create its tag until published, the collision was invisible: the run went green and produced a draft that would only have failed at publish time. Deleting the v1.28 releases didn't fix it either, since deleting a release leaves its tag behind — the collision would recur on the next run.

Verified against the live tag list

old logic: last_tag=v1.27 -> next=v1.28   (collides)
new logic: last_tag=v1.28 -> next=v1.29   (free)

--sort=-v:refname also orders the older three-component tags (v1.5.1, v1.7.1) correctly.

`git rev-list --tags --max-count=1` returns the most recently committed
tagged commit, which is not necessarily the highest version number. v1.27
was tagged on a 2026-04-23 commit while v1.28 was tagged on an older
2026-04-10 commit, so the old logic picked v1.27 and computed a next tag
of v1.28 -- which already existed.

Because a draft release does not create its tag until it is published,
this produced a draft that looked fine and would only have failed at
publish time.

Sorting with `--sort=-v:refname` gives v1.28, so the next tag is v1.29.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@robredpath
robredpath merged commit ed48115 into master Aug 4, 2026
2 checks passed
@robredpath
robredpath deleted the fix-release-tag-sort branch August 4, 2026 16:06
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.

2 participants