Skip to content

Commit c220ad8

Browse files
author
Evilazaro Alves
committed
Fix new tag version
1 parent 5e3d5a9 commit c220ad8

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

.github/actions/ci/generate-release/action.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,17 @@ runs:
6363
run: |
6464
# Fetch all tags
6565
git fetch --tags --force
66-
# Get the latest tag matching v<major>.<minor>.<patch>
67-
tag=$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*' | sort -V | tail -n 1)
66+
# Get the latest tag matching v<major>.<minor>.<patch> optionally with a suffix
67+
tag=$(git tag --list 'v[0-9]*.[0-9]*.[0-9]*'* | sort -V | tail -n 1)
6868
if [ -z "$tag" ]; then
6969
tag="v0.0.0"
7070
fi
71-
echo "tag=$tag" >> $GITHUB_OUTPUT
72-
echo "✅ Latest tag: $tag"
71+
72+
# If tag matches v<major>.<minor>.<patch>-<suffix>, extract only v<major>.<minor>.<patch>
73+
base_tag=$(echo "$tag" | sed -E 's/^(v[0-9]+\.[0-9]+\.[0-9]+).*$/\1/')
74+
75+
echo "tag=$base_tag" >> $GITHUB_OUTPUT
76+
echo "✅ Latest tag: $base_tag"
7377
7478
- name: Determine release type and strategy
7579
shell: bash
@@ -295,7 +299,7 @@ runs:
295299
version_suffix="${version_suffix}-pr${{ github.event.number }}"
296300
fi
297301
298-
new_version="v$major.$minor.$patch"
302+
new_version="v$major.$minor.$patch-$version_suffix"
299303
echo "✅ Next version: $new_version"
300304
echo "📊 Final version breakdown: major=$major, minor=$minor, patch=$patch"
301305
echo "new_version=$new_version" >> $GITHUB_OUTPUT

0 commit comments

Comments
 (0)