File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -23,14 +23,15 @@ jobs:
2323 - name : Get next version
2424 id : version
2525 run : |
26- LATEST_TAG=$(git tag --sort=-version:refname | grep "^v[0-9]" | head -n1 || echo "v0.0.0")
27- echo "Latest tag: $LATEST_TAG"
28- VERSION=${ LATEST_TAG#v}
26+ # Get the latest version tag or set default
27+ LATEST_TAG=$(git tag --sort=-version:refname | grep "^v[0-9]" | head -n1)
28+ echo "Latest tag found: '$ LATEST_TAG'"
2929
30- # Handle case where no tags exist yet
31- if [ "$VERSION" = "0.0.0 " ]; then
30+ # If no tags exist, start with v0.0.1
31+ if [ -z "$LATEST_TAG " ]; then
3232 NEW_TAG="v0.0.1"
3333 else
34+ VERSION=${LATEST_TAG#v}
3435 IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
3536 PATCH=$((PATCH + 1))
3637 NEW_TAG="v$MAJOR.$MINOR.$PATCH"
You can’t perform that action at this time.
0 commit comments