Skip to content

Commit 140c3d8

Browse files
committed
fix permissions error in build flow
1 parent 72db343 commit 140c3d8

1 file changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/build.yaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
pull_request:
77
branches: [ main ]
88

9+
permissions:
10+
contents: write
11+
912
jobs:
1013
build:
1114
runs-on: ubuntu-latest
@@ -41,7 +44,11 @@ jobs:
4144
git config --local user.email "action@github.com"
4245
git config --local user.name "GitHub Action"
4346
git add resume.pdf
44-
git diff --staged --quiet || git commit -m "Auto-update resume PDF"
45-
git push
47+
if git diff --staged --quiet; then
48+
echo "No changes to commit"
49+
else
50+
git commit -m "Auto-update resume PDF"
51+
git push https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:main
52+
fi
4653
env:
4754
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)