forked from ml-explore/mlx-swift
-
Notifications
You must be signed in to change notification settings - Fork 2
45 lines (37 loc) · 1.39 KB
/
upstream-sync.yml
File metadata and controls
45 lines (37 loc) · 1.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
name: 🔄 Auto-Sync Upstream
on:
schedule:
- cron: '0 4 * * *' # Every day at 4:00 AM UTC
workflow_dispatch: # Enable manual triggers
permissions:
contents: write
pull-requests: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
- name: Configure Git
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Add Upstream Remote
run: git remote add upstream https://github.com/ml-explore/mlx-swift.git
- name: Fetch Upstream
run: git fetch upstream
- name: Create or Update Sync Branch
run: |
git checkout -B sync/upstream-latest
git reset --hard upstream/main
git push -f origin sync/upstream-latest
- name: Create Pull Request to Main
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh pr create --base main --head sync/upstream-latest \
--title "🔄 Auto-Sync: Apple Upstream Repository" \
--body "Automated PR to synchronize SharpAI fork with Apple mlx-swift upstream repository. Please review merge conflicts (if any) and verify CI pipelines." || echo "PR already exists or no changes"