Rounak Bende commited on
Commit
48bc1f9
·
unverified ·
1 Parent(s): 9e9e914

fix: use PAT for CSV auto-update workflow (#14)

Browse files

GITHUB_TOKEN cannot bypass branch protection ruleset.
Use PAT_TOKEN secret (repo admin has bypass permission).

Files changed (1) hide show
  1. .github/workflows/update-csv.yml +1 -4
.github/workflows/update-csv.yml CHANGED
@@ -15,7 +15,7 @@ jobs:
15
  steps:
16
  - uses: actions/checkout@v4
17
  with:
18
- persist-credentials: false
19
 
20
  - uses: actions/setup-python@v5
21
  with:
@@ -28,11 +28,8 @@ jobs:
28
  run: python src/results_to_csv.py
29
 
30
  - name: Commit if changed
31
- env:
32
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
33
  run: |
34
  git config user.name "github-actions[bot]"
35
  git config user.email "github-actions[bot]@users.noreply.github.com"
36
- git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${{ github.repository }}
37
  git add results.csv
38
  git diff --staged --quiet || (git commit -m "Auto-update results.csv" && git push)
 
15
  steps:
16
  - uses: actions/checkout@v4
17
  with:
18
+ token: ${{ secrets.PAT_TOKEN }}
19
 
20
  - uses: actions/setup-python@v5
21
  with:
 
28
  run: python src/results_to_csv.py
29
 
30
  - name: Commit if changed
 
 
31
  run: |
32
  git config user.name "github-actions[bot]"
33
  git config user.email "github-actions[bot]@users.noreply.github.com"
 
34
  git add results.csv
35
  git diff --staged --quiet || (git commit -m "Auto-update results.csv" && git push)