Skip to content

Commit 54e0f13

Browse files
authored
fix: add contents write permission and force tag updates
1 parent ca33540 commit 54e0f13

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

.github/workflows/release.yml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
default: 'main'
1616
required: true
1717

18+
permissions:
19+
contents: write
20+
1821
jobs:
1922
re-tag:
2023
runs-on: ubuntu-latest
@@ -30,14 +33,10 @@ jobs:
3033
- name: Update tag with parameter
3134
if: github.event.inputs.tag != ''
3235
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
36+
git tag -fa ${{ inputs.tag }} -m 'Retag ${{ inputs.tag }}'
37+
git push origin ${{ inputs.tag }} --force
38+
- name: Update rolling tag
3839
if: github.event.inputs.tag == ''
3940
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
41+
git tag -fa v2 -m 'Retag v2'
42+
git push origin v2 --force

0 commit comments

Comments
 (0)