Skip to content

Commit 085e9e1

Browse files
committed
fix version detection with release trigger
1 parent f7396a3 commit 085e9e1

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

.github/workflows/release-trigger.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,10 @@ jobs:
4444
echo "Using manual version: $VERSION"
4545
else
4646
# Auto-increment patch version
47-
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
47+
# Use sort-based approach instead of git describe, because git describe only finds
48+
# tags reachable from HEAD and misses tags on unmerged release branches.
49+
LATEST_TAG=$(git tag -l 'v[0-9]*.[0-9]*.[0-9]*' --sort=-version:refname | head -n 1)
50+
LATEST_TAG="${LATEST_TAG:-v0.0.0}"
4851
echo "Latest tag: $LATEST_TAG"
4952
5053
# Extract version number and increment

0 commit comments

Comments
 (0)