|
| 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 | + token: ${{ secrets.PAT_TOKEN }} |
| 21 | + |
| 22 | + - name: Configure git |
| 23 | + run: | |
| 24 | + git config user.name "github-actions[bot]" |
| 25 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 26 | +
|
| 27 | + - name: Fetch upstream dev |
| 28 | + run: | |
| 29 | + git remote add upstream https://github.com/open-webui/open-webui.git |
| 30 | + git fetch upstream dev |
| 31 | +
|
| 32 | + - name: Fast-forward merge upstream/dev |
| 33 | + run: git merge --ff-only upstream/dev |
| 34 | + |
| 35 | + - name: Push to origin |
| 36 | + run: git push origin dev |
| 37 | + |
| 38 | + sync-main: |
| 39 | + runs-on: ubuntu-latest |
| 40 | + if: github.repository != 'open-webui/open-webui' |
| 41 | + permissions: |
| 42 | + contents: write |
| 43 | + steps: |
| 44 | + - name: Checkout main branch |
| 45 | + uses: actions/checkout@v4 |
| 46 | + with: |
| 47 | + ref: main |
| 48 | + fetch-depth: 0 |
| 49 | + token: ${{ secrets.PAT_TOKEN }} |
| 50 | + |
| 51 | + - name: Configure git |
| 52 | + run: | |
| 53 | + git config user.name "github-actions[bot]" |
| 54 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 55 | +
|
| 56 | + - name: Fetch upstream main |
| 57 | + run: | |
| 58 | + git remote add upstream https://github.com/open-webui/open-webui.git |
| 59 | + git fetch upstream main |
| 60 | +
|
| 61 | + - name: Fast-forward merge upstream/main |
| 62 | + run: git merge --ff-only upstream/main |
| 63 | + |
| 64 | + - name: Push to origin |
| 65 | + run: git push origin main |
| 66 | + |
| 67 | + sync-personal: |
| 68 | + runs-on: ubuntu-latest |
| 69 | + if: github.repository != 'open-webui/open-webui' |
| 70 | + needs: [sync-dev] |
| 71 | + permissions: |
| 72 | + contents: write |
| 73 | + steps: |
| 74 | + - name: Checkout personal branch |
| 75 | + uses: actions/checkout@v4 |
| 76 | + with: |
| 77 | + ref: personal |
| 78 | + fetch-depth: 0 |
| 79 | + token: ${{ secrets.PAT_TOKEN }} |
| 80 | + |
| 81 | + - name: Configure git |
| 82 | + run: | |
| 83 | + git config user.name "github-actions[bot]" |
| 84 | + git config user.email "github-actions[bot]@users.noreply.github.com" |
| 85 | +
|
| 86 | + - name: Fetch upstream dev |
| 87 | + run: | |
| 88 | + git remote add upstream https://github.com/open-webui/open-webui.git |
| 89 | + git fetch upstream dev |
| 90 | +
|
| 91 | + - name: Rebase onto upstream/dev |
| 92 | + run: git rebase upstream/dev |
| 93 | + |
| 94 | + - name: Force push |
| 95 | + run: git push --force origin personal |
0 commit comments