forked from supabase/realtime
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (64 loc) · 2.4 KB
/
upsteam-sync.yml
File metadata and controls
75 lines (64 loc) · 2.4 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
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