-
Notifications
You must be signed in to change notification settings - Fork 8
Add scheduled workflow to auto-sync fork with upstream #632
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,23 @@ | ||||||||||||||||||||||||||||||||
| name: Sync Fork with Upstream | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| on: | ||||||||||||||||||||||||||||||||
| schedule: | ||||||||||||||||||||||||||||||||
| - cron: '0 */3 * * 1-5' # Every 3 hours, Monday-Friday | ||||||||||||||||||||||||||||||||
| - cron: '0 9 * * 0,6' # Once daily at 09:00 UTC, Saturday-Sunday | ||||||||||||||||||||||||||||||||
| workflow_dispatch: # Allow manual trigger | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| permissions: | ||||||||||||||||||||||||||||||||
| contents: write | ||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||
| jobs: | ||||||||||||||||||||||||||||||||
| sync: | ||||||||||||||||||||||||||||||||
| runs-on: ubuntu-latest | ||||||||||||||||||||||||||||||||
| steps: | ||||||||||||||||||||||||||||||||
| - name: Sync fork with upstream | ||||||||||||||||||||||||||||||||
| env: | ||||||||||||||||||||||||||||||||
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||
| gh api \ | ||||||||||||||||||||||||||||||||
| --method POST \ | ||||||||||||||||||||||||||||||||
| /repos/${{ github.repository }}/merge-upstream \ | ||||||||||||||||||||||||||||||||
| -f branch=main | ||||||||||||||||||||||||||||||||
|
Comment on lines
+20
to
+23
|
||||||||||||||||||||||||||||||||
| gh api \ | |
| --method POST \ | |
| /repos/${{ github.repository }}/merge-upstream \ | |
| -f branch=main | |
| set -euo pipefail | |
| BRANCH="main" | |
| if ! gh api \ | |
| --method POST \ | |
| /repos/${{ github.repository }}/merge-upstream \ | |
| -f branch="${BRANCH}"; then | |
| echo "::error::Failed to sync fork with upstream for branch '${BRANCH}'. Check for merge conflicts, API errors, or authentication issues." | |
| exit 1 | |
| fi |
Copilot
AI
Feb 23, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider adding a conditional check or configuration to handle situations where the upstream and fork have diverged significantly and automatic merging may not be appropriate. The workflow description mentions that "the only divergence for our rocm/xla:main between openxla/xla:main is under .github," but if this assumption is violated in the future, automatic merging could cause issues. Consider adding a check to ensure the merge is only attempted when it's safe to do so, or documenting the expected state clearly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workflow file is missing the standard Apache 2.0 copyright header that is consistently used across all other workflow files in this repository. All other workflow files in .github/workflows/ include a copyright header at the top (see ci.yml:1-14, rocm_xla_ci.yml:1-14, ci_multi_device.yml:1-14, cpu_benchmarks_nightly.yml:1-14, buildifier.yml:1-14, etc.). Please add the copyright header to maintain consistency.