Skip to content

Commit 897ebf8

Browse files
authored
fix: add permissions and git config for semantic-release (#8)
- Add explicit permissions: contents write, issues write, pull-requests write - Configure git credentials with GitHub token for pushing tags/commits - Set proper git user for semantic-release commits Resolves EGITNOPERMISSION error in semantic-release workflow.
1 parent 752f626 commit 897ebf8

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

.github/workflows/release.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,11 @@ on:
55
branches:
66
- main
77

8+
permissions:
9+
contents: write
10+
issues: write
11+
pull-requests: write
12+
813
jobs:
914
release:
1015
runs-on: ubuntu-latest
@@ -16,6 +21,7 @@ jobs:
1621
with:
1722
fetch-depth: 0
1823
token: ${{ secrets.GITHUB_TOKEN }}
24+
persist-credentials: false
1925

2026
- name: Setup Node.js
2127
uses: actions/setup-node@v4
@@ -26,6 +32,12 @@ jobs:
2632
- name: Install dependencies
2733
run: npm ci
2834

35+
- name: Configure Git
36+
run: |
37+
git config --global user.name "github-actions[bot]"
38+
git config --global user.email "github-actions[bot]@users.noreply.github.com"
39+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
40+
2941
- name: Release
3042
env:
3143
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)