Skip to content

Commit 93f1636

Browse files
committed
Simplify git authentication for maven-release-plugin
- Use persist-credentials: false in checkout - Set remote URL with token in Configure Git step - Remove complex URL rewriting - Keep fetch-depth: 0 for release plugin to access full history
1 parent 483ac2e commit 93f1636

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

.github/workflows/maven-release.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,9 @@ jobs:
1313
- name: Checkout code
1414
uses: actions/checkout@v4
1515
with:
16-
token: ${{ secrets.GITHUB_TOKEN }}
16+
persist-credentials: false
1717
fetch-depth: 0
1818

19-
- name: Configure Git for HTTPS
20-
run: |
21-
git config --global url."https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "[email protected]:"
22-
git config --global url."https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/".insteadOf "https://github.com/"
23-
2419
- name: Set up JDK 17
2520
uses: actions/setup-java@v4
2621
with:
@@ -35,6 +30,7 @@ jobs:
3530
run: |
3631
git config user.name "GitHub Actions"
3732
git config user.email "[email protected]"
33+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git
3834
3935
- name: Set up Maven settings.xml
4036
uses: s4u/maven-settings-action@v2

0 commit comments

Comments
 (0)