Skip to content

Commit 4f21e82

Browse files
committed
fix: action
1 parent dc6db3d commit 4f21e82

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

.github/workflows/station-check.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
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: |
@@ -41,9 +41,15 @@ jobs:
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 }}

0 commit comments

Comments
 (0)