Skip to content

Commit 51926a7

Browse files
Copilottomgrv
andcommitted
fix: improve version extraction logic for better semver detection
Co-authored-by: tomgrv <[email protected]>
1 parent 2c387f2 commit 51926a7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.10.2-1-g97bdb34-dirty
1+
5.10.2-2-g2c387f2-dirty

update-version.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ extract_semver_from_describe() {
3131
if command -v dotnet-gitversion >/dev/null 2>&1; then
3232
# Try to get MajorMinorPatch from GitVersion
3333
GITVERSION_OUTPUT=$(dotnet-gitversion -config .gitversion -showvariable MajorMinorPatch 2>/dev/null || echo "")
34-
# Check if output is a valid version number (only digits and dots)
35-
if [ -n "$GITVERSION_OUTPUT" ] && echo "$GITVERSION_OUTPUT" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then
34+
# Check if output is a valid version number (only digits and dots) and not default
35+
if [ -n "$GITVERSION_OUTPUT" ] && echo "$GITVERSION_OUTPUT" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$' && [ "$GITVERSION_OUTPUT" != "1.0.0" ]; then
3636
update_version_file "$GITVERSION_OUTPUT"
3737
exit 0
3838
fi

0 commit comments

Comments
 (0)