Skip to content

Commit 150db7e

Browse files
committed
Fix GitHub Actions permissions for release workflow
- Add contents:write permission to allow pushing tags and commits - Configure git credentials properly for automated releases - Use persist-credentials to maintain authentication for push operations
1 parent b3da544 commit 150db7e

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

.github/workflows/release.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@ on:
1616
jobs:
1717
release:
1818
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
actions: read
1922

2023
steps:
2124
- name: Checkout code
2225
uses: actions/checkout@v4
2326
with:
2427
fetch-depth: 0
2528
token: ${{ secrets.GITHUB_TOKEN }}
29+
persist-credentials: true
2630

2731
- name: Set up JDK 21
2832
uses: actions/setup-java@v4
@@ -39,8 +43,8 @@ jobs:
3943

4044
- name: Configure Git
4145
run: |
42-
git config --global user.name "github-actions[bot]"
43-
git config --global user.email "github-actions[bot]@users.noreply.github.com"
46+
git config --local user.name "github-actions[bot]"
47+
git config --local user.email "github-actions[bot]@users.noreply.github.com"
4448
4549
- name: Build and test main library
4650
run: mvn clean install

0 commit comments

Comments
 (0)