File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -232,7 +232,12 @@ jobs:
232232 NEW_TAG="${{ needs.build.outputs.tag }}"
233233
234234 # Get all matching tags, exclude the new tag if it exists, and get the latest
235- PREVIOUS_TAG=$(git tag -l "${TAG_PATTERN}" | grep -v "^${NEW_TAG}$" | sort -V | tail -n1)
235+ # For main branch, also exclude dev tags (v-dev-*) to prevent incorrect comparisons
236+ if [ "$BRANCH_NAME" = "main" ]; then
237+ PREVIOUS_TAG=$(git tag -l "${TAG_PATTERN}" | grep -v "^${NEW_TAG}$" | grep -v "^v-.*-" | sort -V | tail -n1)
238+ else
239+ PREVIOUS_TAG=$(git tag -l "${TAG_PATTERN}" | grep -v "^${NEW_TAG}$" | sort -V | tail -n1)
240+ fi
236241
237242 if [ -z "$PREVIOUS_TAG" ]; then
238243 echo "No previous tag found, showing last 20 commits"
You can’t perform that action at this time.
0 commit comments