Skip to content

Commit c84b4d4

Browse files
committed
fix: address code review comment
1 parent 54e0f13 commit c84b4d4

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

.github/workflows/release.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,13 +30,9 @@ jobs:
3030
run: |
3131
git config user.name 'github-actions'
3232
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
33-
- name: Update tag with parameter
34-
if: github.event.inputs.tag != ''
35-
run: |
36-
git tag -fa ${{ inputs.tag }} -m 'Retag ${{ inputs.tag }}'
37-
git push origin ${{ inputs.tag }} --force
3833
- name: Update rolling tag
39-
if: github.event.inputs.tag == ''
4034
run: |
41-
git tag -fa v2 -m 'Retag v2'
42-
git push origin v2 --force
35+
# Get the major version from the latest tag
36+
MAJOR_VERSION=`git tag --list --sort=-v:refname | head -n1 | cut -d. -f1`
37+
git tag --force --annotate ${{ inputs.tag || '$MAJOR_VERSION' }} --message 'Retag ${{ inputs.tag || '$MAJOR_VERSION' }}'
38+
git push origin ${{ inputs.tag || '$MAJOR_VERSION' }} --force

0 commit comments

Comments
 (0)