Skip to content
Closed
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
23 changes: 23 additions & 0 deletions .github/workflows/sync_upstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Sync Fork with Upstream
Copy link

Copilot AI Feb 23, 2026

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.

Copilot uses AI. Check for mistakes.

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
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The workflow lacks error handling and notification mechanisms. If the merge-upstream API call fails (e.g., due to merge conflicts, API errors, or authentication issues), the workflow will silently fail without notifying anyone. Consider adding error handling to capture failure scenarios and optionally send notifications (e.g., via GitHub Actions failure notifications or by creating an issue) so that merge conflicts or other problems can be addressed promptly.

Suggested change
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 uses AI. Check for mistakes.
Comment on lines +19 to +23
Copy link

Copilot AI Feb 23, 2026

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.

Copilot uses AI. Check for mistakes.
Loading