Skip to content

Commit 8a3f7a9

Browse files
Cristhian LunaCristhian Luna
authored andcommitted
ci: fix GitHub release step — add contents:write permission and create tag
The GITHUB_TOKEN lacked write access causing a 403 on release creation. Also adds an explicit git tag push before the release step, required when the workflow is triggered by a branch push rather than a tag push.
1 parent 0ec70d6 commit 8a3f7a9

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

.github/workflows/publish.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ on:
88
jobs:
99
publish:
1010
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
1113

1214
steps:
1315
- name: Checkout
@@ -66,6 +68,11 @@ jobs:
6668
env:
6769
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
6870

71+
- name: Create git tag
72+
run: |
73+
git tag v${{ steps.pkg.outputs.version }}
74+
git push origin v${{ steps.pkg.outputs.version }}
75+
6976
- name: Create GitHub release
7077
uses: softprops/action-gh-release@v2
7178
with:

0 commit comments

Comments
 (0)