Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make daily sync permissions at the workflow level and fix merge CI #143

Merged
merged 6 commits into from
Nov 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions .github/workflows/rocm-nightly-upstream-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,22 @@ on:
workflow_dispatch:
schedule:
- cron: '0 6 * * 1-5'
permissions:
contents: write
pull-requests: write
env:
SYNC_BRANCH_NAME: ci-upstream-sync-${{ github.run_number }}_${{ github.run_attempt }}
jobs:
sync-main:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- run: gh repo sync rocm/jax -b main
- run: |
gh auth status
gh repo sync rocm/jax -b main
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
create-sync-branch:
needs: sync-main
permissions:
contents: write
runs-on: ubuntu-latest
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Expand All @@ -32,11 +33,15 @@ jobs:
git fetch
git checkout origin/main
git checkout -b $SYNC_BRANCH_NAME
# Try and merge rocm-main into this new branch so that we don't run upstream's CI code
git config --global user.email "[email protected]"
git config --global user.name "GitHub Actions"
git merge origin/rocm-main || true
# If the merge creates conflicts, we want to abort and push to origin anyways so that a dev can resolve the conflicts
git merge --abort || true
git push origin HEAD
open-sync-pr:
needs: create-sync-branch
permissions:
pull-requests: write
runs-on: ubuntu-latest
steps:
- run: |
Expand Down
Loading