Sync with upstream #4
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 with upstream | |
| on: | |
| schedule: | |
| - cron: '0 6 * * *' # Run daily at 6 AM UTC | |
| workflow_dispatch: # Allow manual trigger | |
| jobs: | |
| sync: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "github-actions[bot]" | |
| git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Add upstream remote | |
| run: git remote add upstream https://github.com/supabase/realtime | |
| - name: Fetch upstream and origin | |
| run: | | |
| git fetch upstream | |
| git fetch origin | |
| - name: Check for changes | |
| id: check | |
| run: | | |
| # Check if upstream branch exists and compare, otherwise compare with HEAD | |
| if git rev-parse --verify origin/upstream >/dev/null 2>&1; then | |
| if git diff --quiet origin/upstream upstream/main; then | |
| echo "changes=false" >> $GITHUB_OUTPUT | |
| else | |
| echo "changes=true" >> $GITHUB_OUTPUT | |
| fi | |
| else | |
| # First time running, upstream branch doesn't exist yet | |
| echo "changes=true" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Sync if changes exist | |
| if: steps.check.outputs.changes == 'true' | |
| run: | | |
| git checkout -B upstream | |
| git merge upstream/main | |
| git push origin upstream | |
| - name: Create Pull Request | |
| if: steps.check.outputs.changes == 'true' | |
| uses: peter-evans/create-pull-request@v5 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| branch: upstream | |
| base: main | |
| title: "🔄 Sync with upstream changes" | |
| body: | | |
| ## Upstream Sync | |
| This PR contains the latest changes from the upstream repository. | |
| **Changes included:** | |
| - Synced from upstream/main | |
| - Auto-generated by upstream sync workflow | |
| **Review checklist:** | |
| - [ ] Review the changes for any breaking changes | |
| - [ ] Check for conflicts with local modifications | |
| - [ ] Verify tests pass (if applicable) | |
| --- | |
| *This PR was automatically created by the upstream sync workflow* | |
| draft: false |