Skip to content

Commit 79c0cd4

Browse files
authored
Use a GitHub app for syncing rocm-main and upstream main (#224)
1 parent 81f8e65 commit 79c0cd4

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

.github/workflows/rocm-nightly-upstream-sync.yml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,18 @@ jobs:
1515
sync-main:
1616
runs-on: ubuntu-latest
1717
steps:
18-
- run: |
18+
- name: Generate an app token
19+
id: generate-token
20+
uses: actions/create-github-app-token@v1
21+
with:
22+
app-id: ${{ vars.ROCM_REPO_MANAGEMENT_API_2_ID }}
23+
private-key: ${{ secrets.ROCM_REPO_MANAGEMENT_API_2_PRIV_KEY }}
24+
- name: Sync our main with upstream main
25+
run: |
1926
gh auth status
2027
gh repo sync rocm/jax -b main
2128
env:
22-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
29+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
2330
create-sync-branch:
2431
needs: sync-main
2532
runs-on: ubuntu-latest
@@ -44,9 +51,16 @@ jobs:
4451
needs: create-sync-branch
4552
runs-on: ubuntu-latest
4653
steps:
47-
- run: |
54+
- name: Generate an app token
55+
id: generate-token
56+
uses: actions/create-github-app-token@v1
57+
with:
58+
app-id: ${{ vars.ROCM_REPO_MANAGEMENT_API_2_ID }}
59+
private-key: ${{ secrets.ROCM_REPO_MANAGEMENT_API_2_PRIV_KEY }}
60+
- name: Open a PR to rocm-main
61+
run: |
4862
gh pr create --repo $GITHUB_REPOSITORY --head $SYNC_BRANCH_NAME --base rocm-main --title "CI: $(date +%x) upstream sync" --body "Daily sync with upstream"
4963
gh pr merge --repo $GITHUB_REPOSITORY --merge --auto $SYNC_BRANCH_NAME
5064
env:
51-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
65+
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
5266

0 commit comments

Comments
 (0)