File tree Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Expand file tree Collapse file tree 1 file changed +8
-13
lines changed Original file line number Diff line number Diff line change 1515 default : ' main'
1616 required : true
1717
18+ permissions :
19+ contents : write
20+
1821jobs :
1922 re-tag :
2023 runs-on : ubuntu-latest
2730 run : |
2831 git config user.name 'github-actions'
2932 git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
30- - name : Update tag with parameter
31- if : github.event.inputs.tag != ''
32- run : |
33- git tag --delete ${{ inputs.tag }} || true
34- git push --delete origin ${{ inputs.tag }} || true
35- git tag -a ${{ inputs.tag }} -m 'Retag ${{ inputs.tag }}'
36- git push origin ${{ inputs.tag }}
37- - name : Update tag to v2
38- if : github.event.inputs.tag == ''
33+ - name : Update rolling tag
3934 run : |
40- git tag --delete v2 || true
41- git push --delete origin v2 || true
42- git tag -a v2 -m 'Retag v2 '
43- git push origin v2
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
You can’t perform that action at this time.
0 commit comments