Skip to content

Commit f971a62

Browse files
authored
Adjust sync_to_upstream to use App Token for authentication (#16)
Incoming commits from upstream may contain changes to the `.github` directory, but GitHub workflows are not allowed to modify these contents by default. To allow such commits to be fetched from upstream successfully, this adjusts the sync_from_upstream.yml workflow to use a GitHub App token for authentication when checking out the repo.
1 parent 087e130 commit f971a62

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/sync_from_upstream.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,17 @@ jobs:
1414
env:
1515
UPSTREAM_REMOTE: https://github.com/llvm/llvm-project.git
1616
steps:
17+
- name: Configure Access Token
18+
uses: actions/create-github-app-token@v1
19+
id: generate-token
20+
with:
21+
app-id: ${{ secrets.SYNC_APP_ID }}
22+
private-key: ${{ secrets.SYNC_APP_PRIVATE_KEY }}
1723
- name: Checkout
1824
uses: actions/checkout@v4
1925
with:
2026
ref: ${{ matrix.branch }}
27+
token: ${{ steps.generate-token.outputs.token }}
2128
- name: Configure Upstream Remote
2229
run: git remote add upstream ${{ env.UPSTREAM_REMOTE }}
2330
- name: Fetch Upstream Changes

0 commit comments

Comments
 (0)