Skip to content

Commit 471f72e

Browse files
committed
Fix release script once again
1 parent 49f2f81 commit 471f72e

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

.github/workflows/release.yml

+13-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ jobs:
3333
- name: Get Latest Tag
3434
run: |
3535
latest_tag=$(git describe --tags $(git rev-list --tags --max-count=1) || echo "v0.0.0")
36+
37+
if ! [[ $latest_tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
38+
echo "Error: Tag format is invalid. Expected format: vX.X.X"
39+
exit 1
40+
fi
41+
3642
echo "Latest tag: $latest_tag"
3743
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
3844
@@ -90,7 +96,13 @@ jobs:
9096
patch=0
9197
fi
9298
93-
new_tag="v$major.$minor.$patch"
99+
new_tag="$major.$minor.$patch"
100+
101+
if ! [[ $new_tag =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
102+
echo "Error: New tag's format is invalid. Expected format: vX.X.X"
103+
exit 1
104+
fi
105+
94106
echo "New tag: $new_tag"
95107
echo "new_tag=$new_tag" >> $GITHUB_ENV
96108

0 commit comments

Comments
 (0)