Skip to content

Commit 6e50982

Browse files
Algorithm5838github-actions[bot]
authored andcommitted
ci: consolidate fork sync to cover dev, main, and personal branches
1 parent 14ea789 commit 6e50982

1 file changed

Lines changed: 92 additions & 0 deletions

File tree

.github/workflows/sync-fork.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Sync fork with upstream
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # Daily at midnight UTC
6+
workflow_dispatch:
7+
8+
jobs:
9+
sync-dev:
10+
runs-on: ubuntu-latest
11+
if: github.repository != 'open-webui/open-webui'
12+
permissions:
13+
contents: write
14+
steps:
15+
- name: Checkout dev branch
16+
uses: actions/checkout@v4
17+
with:
18+
ref: dev
19+
fetch-depth: 0
20+
21+
- name: Configure git
22+
run: |
23+
git config user.name "github-actions[bot]"
24+
git config user.email "github-actions[bot]@users.noreply.github.com"
25+
26+
- name: Fetch upstream dev
27+
run: |
28+
git remote add upstream https://github.com/open-webui/open-webui.git
29+
git fetch upstream dev
30+
31+
- name: Fast-forward merge upstream/dev
32+
run: git merge --ff-only upstream/dev
33+
34+
- name: Push to origin
35+
run: git push origin dev
36+
37+
sync-main:
38+
runs-on: ubuntu-latest
39+
if: github.repository != 'open-webui/open-webui'
40+
permissions:
41+
contents: write
42+
steps:
43+
- name: Checkout main branch
44+
uses: actions/checkout@v4
45+
with:
46+
ref: main
47+
fetch-depth: 0
48+
49+
- name: Configure git
50+
run: |
51+
git config user.name "github-actions[bot]"
52+
git config user.email "github-actions[bot]@users.noreply.github.com"
53+
54+
- name: Fetch upstream main
55+
run: |
56+
git remote add upstream https://github.com/open-webui/open-webui.git
57+
git fetch upstream main
58+
59+
- name: Fast-forward merge upstream/main
60+
run: git merge --ff-only upstream/main
61+
62+
- name: Push to origin
63+
run: git push origin main
64+
65+
sync-personal:
66+
runs-on: ubuntu-latest
67+
if: github.repository != 'open-webui/open-webui'
68+
needs: [sync-dev]
69+
permissions:
70+
contents: write
71+
steps:
72+
- name: Checkout personal branch
73+
uses: actions/checkout@v4
74+
with:
75+
ref: personal
76+
fetch-depth: 0
77+
78+
- name: Configure git
79+
run: |
80+
git config user.name "github-actions[bot]"
81+
git config user.email "github-actions[bot]@users.noreply.github.com"
82+
83+
- name: Fetch upstream dev
84+
run: |
85+
git remote add upstream https://github.com/open-webui/open-webui.git
86+
git fetch upstream dev
87+
88+
- name: Rebase onto upstream/dev
89+
run: git rebase upstream/dev
90+
91+
- name: Force push
92+
run: git push --force origin personal

0 commit comments

Comments
 (0)