Skip to content

Commit 69e93e5

Browse files
authored
Create a new branch when merging upstream main to rocm-main (#128)
1 parent ea7683f commit 69e93e5

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

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

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ on:
66
workflow_dispatch:
77
schedule:
88
- cron: '0 6 * * 1-5'
9+
env:
10+
SYNC_BRANCH_NAME: ci-upstream-sync-${{ github.run_number }}_${{ github.run_attempt }}
911
jobs:
1012
sync-main:
1113
permissions:
@@ -15,12 +17,28 @@ jobs:
1517
- run: gh repo sync rocm/jax -b main
1618
env:
1719
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
20+
create-sync-branch:
21+
needs: sync-main
22+
permissions:
23+
contents: write
24+
runs-on: ubuntu-latest
25+
env:
26+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
27+
steps:
28+
- name: Checkout code
29+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
30+
- name: Create branch
31+
run: |
32+
git checkout -b $SYNC_BRANCH_NAME main
33+
git push origin HEAD
1834
open-sync-pr:
35+
needs: create-sync-branch
1936
permissions:
2037
pull-requests: write
2138
runs-on: ubuntu-latest
2239
steps:
2340
- run: |
24-
gh pr create --repo $GITHUB_REPOSITORY --head main --base rocm-main --title "CI: $(date +%x) upstream sync" --body "Daily sync with upstream"
41+
gh pr create --repo $GITHUB_REPOSITORY --head $SYNC_BRANCH_NAME --base rocm-main --title "CI: $(date +%x) upstream sync" --body "Daily sync with upstream"
2542
env:
2643
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
44+

0 commit comments

Comments
 (0)