Skip to content

Commit 69e177f

Browse files
committed
fix: CI release versioning — use sorted tags instead of git describe
git describe picks an arbitrary tag when multiple tags point to the same commit (v0.0.4 and v0.0.5 both on 4f1a01e), causing duplicate release attempts. Switch to `git tag -l --sort=-v:refname` for reliable highest-version detection. Also add fetch-tags: true.
1 parent f6ca505 commit 69e177f

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,14 @@ jobs:
238238
uses: actions/checkout@v4
239239
with:
240240
fetch-depth: 0
241+
fetch-tags: true
241242

242243
- name: Determine version bump
243244
id: version
244245
run: |
245-
# Get latest tag or default to v0.0.0
246-
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
246+
# Get highest semver tag (git describe can pick wrong tag when multiple tags share a commit)
247+
LATEST_TAG=$(git tag -l 'v*' --sort=-v:refname | head -1)
248+
LATEST_TAG="${LATEST_TAG:-v0.0.0}"
247249
echo "latest_tag=$LATEST_TAG" >> $GITHUB_OUTPUT
248250
249251
# Parse current version

0 commit comments

Comments
 (0)