File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -38,12 +38,17 @@ jobs:
3838 - name : Get current version
3939 id : current_version
4040 run : |
41- # Get the latest release tag (exclude pre-release tags)
42- LATEST_TAG=$(git tag -l 'v*' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n1 || echo "v0.0.0")
41+ # Get the latest release tag (exclude pre-release/dev tags)
42+ # Only match tags that are exactly v{major}.{minor}.{patch}
43+ LATEST_TAG=$(git tag -l 'v*' | grep -E '^v[0-9]+\.[0-9]+\.[0-9]+$' | sort -V | tail -n1)
44+
4345 if [ -z "$LATEST_TAG" ]; then
46+ echo "No existing semver tags found, starting from v0.0.0"
4447 LATEST_TAG="v0.0.0"
4548 fi
46- echo "Latest tag: ${LATEST_TAG}"
49+
50+ echo "Latest release tag: ${LATEST_TAG}"
51+ echo "Ignoring any dev/pre-release tags"
4752
4853 # Remove 'v' prefix
4954 VERSION=${LATEST_TAG#v}
You can’t perform that action at this time.
0 commit comments