Sync fork with upstream #216
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 CI config: personal always wins for its own workflow | |
| # files (rename-proof — keep "theirs" = personal's version on rebase). | |
| for f in $(git diff --name-only --diff-filter=U); do | |
| case "$f" in | |
| .github/workflows/*) git checkout --theirs -- "$f"; git add -- "$f" ;; | |
| esac | |
| done | |
| # 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 |