Skip to content

Commit 2e65158

Browse files
gburdgithub-actions[bot]
authored andcommitted
ci: use SYNC_TOKEN (workflow scope) for upstream sync push
The default GITHUB_TOKEN is blocked by GitHub from pushing commits that touch .github/workflows/, which broke the auto-sync push step once the fork carried its own workflow files. Use a PAT with repo+workflow scope (SYNC_TOKEN secret), falling back to GITHUB_TOKEN when unset.
1 parent 28b5a3d commit 2e65158

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

.github/workflows/sync-upstream-manual.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,10 @@ jobs:
2121
uses: actions/checkout@v4
2222
with:
2323
fetch-depth: 0
24-
token: ${{ secrets.GITHUB_TOKEN }}
24+
# PAT with repo + workflow scope. The default GITHUB_TOKEN cannot push
25+
# commits that touch .github/workflows/ (platform block). See SYNC_TOKEN
26+
# repo secret.
27+
token: ${{ secrets.SYNC_TOKEN || secrets.GITHUB_TOKEN }}
2528

2629
- name: Configure Git
2730
run: |

.github/workflows/sync-upstream.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ jobs:
1818
uses: actions/checkout@v4
1919
with:
2020
fetch-depth: 0
21-
token: ${{ secrets.GITHUB_TOKEN }}
21+
# PAT with repo + workflow scope. The default GITHUB_TOKEN cannot push
22+
# commits that touch .github/workflows/ (platform block). See SYNC_TOKEN
23+
# repo secret. Falls back to GITHUB_TOKEN if unset (push will fail on
24+
# workflow-file changes, but non-workflow syncs still work).
25+
token: ${{ secrets.SYNC_TOKEN || secrets.GITHUB_TOKEN }}
2226

2327
- name: Configure Git
2428
run: |

0 commit comments

Comments
 (0)