forked from open-webui/open-webui
-
Notifications
You must be signed in to change notification settings - Fork 0
109 lines (93 loc) · 3.17 KB
/
sync-fork.yml
File metadata and controls
109 lines (93 loc) · 3.17 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
name: Sync fork with upstream
on:
schedule:
- cron: '0 0 * * *' # Daily at midnight UTC
workflow_dispatch:
jobs:
sync-dev:
runs-on: ubuntu-latest
if: github.repository != 'open-webui/open-webui'
permissions:
contents: write
steps:
- name: Checkout dev branch
uses: actions/checkout@v6
with:
ref: dev
fetch-depth: 0
token: ${{ secrets.PAT_TOKEN }}
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Fetch upstream dev
run: |
git remote add upstream https://github.com/open-webui/open-webui.git
git fetch upstream dev
- name: Fast-forward merge upstream/dev
run: git merge --ff-only upstream/dev
- name: Push to origin
run: git push origin dev
sync-main:
runs-on: ubuntu-latest
if: github.repository != 'open-webui/open-webui'
permissions:
contents: write
steps:
- name: Checkout main branch
uses: actions/checkout@v6
with:
ref: main
fetch-depth: 0
token: ${{ secrets.PAT_TOKEN }}
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Fetch upstream main
run: |
git remote add upstream https://github.com/open-webui/open-webui.git
git fetch upstream main
- name: Fast-forward merge upstream/main
run: git merge --ff-only upstream/main
- name: Push to origin
run: git push origin main
sync-personal:
runs-on: ubuntu-latest
if: github.repository != 'open-webui/open-webui'
needs: [sync-dev]
permissions:
contents: write
steps:
- name: Checkout personal branch
uses: actions/checkout@v6
with:
ref: personal
fetch-depth: 0
token: ${{ secrets.PAT_TOKEN }}
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Fetch upstream dev
run: |
git remote add upstream https://github.com/open-webui/open-webui.git
git fetch upstream dev
- name: Rebase onto upstream/dev
run: |
if ! git rebase upstream/dev; then
# Auto-resolve docker-build.yaml — always keep our custom version
if git diff --name-only --diff-filter=U | grep -qx '.github/workflows/docker-build.yaml'; then
git checkout --theirs .github/workflows/docker-build.yaml
git add .github/workflows/docker-build.yaml
fi
# Fail if other files still have conflicts
if git diff --name-only --diff-filter=U | grep -q .; then
echo "::error::Unresolvable rebase conflicts"
git rebase --abort
exit 1
fi
GIT_EDITOR=true git rebase --continue
fi
- name: Force push
run: git push --force origin personal