Skip to content

Commit 1faafe0

Browse files
authored
Merge pull request #6 from ReactSphere/copilot/fix-github-actions-permissions
Fix: Authenticate git push and script env var with PAT_TOKEN in update-readme workflow
2 parents ac951bd + f7e3acd commit 1faafe0

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

.github/workflows/update-readme.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,15 @@ jobs:
2626
- name: Generate leaderboard
2727
run: node profile/scripts/updateReadme.js
2828
env:
29-
GITHUB_TOKEN: ${{ secrets.PAT_TOKEN }}
29+
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
3030

3131
- name: Commit & push changes
32+
env:
33+
PAT_TOKEN: ${{ secrets.PAT_TOKEN }}
3234
run: |
3335
git config --global user.name "github-actions[bot]"
3436
git config --global user.email "github-actions[bot]@users.noreply.github.com"
37+
git remote set-url origin https://x-access-token:${PAT_TOKEN}@github.com/${{ github.repository }}.git
3538
git add profile/README.md
3639
git commit -m "Update leaderboard" || echo "No changes"
3740
git push origin HEAD:main

0 commit comments

Comments
 (0)