Skip to content

Commit e0a54df

Browse files
feat: update release workflow to dynamically determine major tag for versioning
1 parent fc9e50d commit e0a54df

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

.github/workflows/release.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,15 @@ jobs:
5454
run: |
5555
git config user.name "github-actions[bot]"
5656
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
57-
git tag -f v1 "$TAG_NAME"
58-
git push origin v1 --force
57+
58+
MAJOR_TAG="${TAG_NAME%%.*}"
59+
if [[ -z "${MAJOR_TAG}" || "${MAJOR_TAG}" == "${TAG_NAME}" ]]; then
60+
echo "::warning::Unable to determine major tag from ${TAG_NAME}; skipping floating tag update."
61+
exit 0
62+
fi
63+
64+
git tag -f "${MAJOR_TAG}" "$TAG_NAME"
65+
git push origin "${MAJOR_TAG}" --force
5966
6067
- name: Publish GitHub release
6168
if: startsWith(github.ref, 'refs/tags/')

0 commit comments

Comments
 (0)