Skip to content

Commit 055a29c

Browse files
authored
[cloudcost-exporter] Only consider semver tags in automated releases (#796)
1 parent e1a5415 commit 055a29c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

.github/workflows/release-on-pr-merge.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,8 +91,10 @@ jobs:
9191
git fetch --tags origin main || true
9292
git checkout main || true
9393
94-
# Calculate version for release
95-
LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "v0.0.0")
94+
# Calculate version for release - only consider semver tags (vMAJOR.MINOR.PATCH)
95+
# to avoid picking up helm chart tags like vcloudcost-exporter-1.1.0
96+
LATEST_TAG=$(git tag -l 'v[0-9]*.[0-9]*.[0-9]*' | sort -V | tail -1)
97+
LATEST_TAG="${LATEST_TAG:-v0.0.0}"
9698
VERSION="${LATEST_TAG#v}"
9799
IFS='.' read -r MAJOR MINOR PATCH <<< "$VERSION"
98100

0 commit comments

Comments
 (0)