File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change 1717 - name : Checkout code
1818 uses : actions/checkout@v4
1919 with :
20- token : ${{ secrets.GITHUB_TOKEN }}
20+ token : ${{ secrets.PAT_TOKEN }}
2121 fetch-depth : 0
2222 persist-credentials : true
2323 sparse-checkout : |
4141
4242 - name : Commit and push changes
4343 if : success() && github.event_name == 'push'
44+ env :
45+ PAT_TOKEN : ${{ secrets.PAT_TOKEN }}
4446 run : |
4547 git config --local user.email "action@github.com"
4648 git config --local user.name "GitHub Action"
49+
50+ # 設置 remote URL 包含 PAT token
51+ git remote set-url origin https://x-access-token:$PAT_TOKEN@github.com/${{ github.repository }}.git
52+
4753 git add resource/station.csv
4854 git diff --staged --quiet || git commit -m "chore: update station.csv from station-dev.csv [skip ci]"
49- git push --force
55+ git push origin ${{ github.ref_name }}
You can’t perform that action at this time.
0 commit comments