From 2fe61db57438635f95eaa8c40f9d81c57fdd311a Mon Sep 17 00:00:00 2001 From: Mike Madeja Date: Fri, 18 Sep 2026 16:42:14 -0500 Subject: [PATCH] fix: use version-sorted tags instead of git describe for release bump 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 --- .github/workflows/CreateRelease.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/CreateRelease.yml b/.github/workflows/CreateRelease.yml index b12e786..5d3207e 100644 --- a/.github/workflows/CreateRelease.yml +++ b/.github/workflows/CreateRelease.yml @@ -28,7 +28,10 @@ jobs: id: get_tag run: | git fetch --tags - latestTag=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0") + latestTag=$(git tag --list 'v*' --sort=-v:refname | head -n 1) + if [ -z "$latestTag" ]; then + latestTag="v0.0.0" + fi echo "Latest tag: $latestTag" echo "latest_tag=$latestTag" >> $GITHUB_OUTPUT