File tree Expand file tree Collapse file tree 1 file changed +44
-0
lines changed
Expand file tree Collapse file tree 1 file changed +44
-0
lines changed Original file line number Diff line number Diff line change 1+ name : Sync with upstream
2+ on :
3+ schedule :
4+ - cron : ' 0 6 * * *' # Run daily at 6 AM UTC
5+ workflow_dispatch : # Allow manual trigger
6+
7+ jobs :
8+ sync :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - uses : actions/checkout@v4
12+ with :
13+ fetch-depth : 0
14+ token : ${{ secrets.GITHUB_TOKEN }}
15+
16+ - name : Add upstream remote
17+ run : git remote add upstream https://github.com/supabase/realtime
18+
19+ - name : Fetch upstream and origin
20+ run : |
21+ git fetch upstream
22+ git fetch origin
23+
24+ - name : Check for changes
25+ id : check
26+ run : |
27+ # Check if upstream branch exists and compare, otherwise compare with HEAD
28+ if git rev-parse --verify origin/upstream >/dev/null 2>&1; then
29+ if git diff --quiet origin/upstream upstream/main; then
30+ echo "changes=false" >> $GITHUB_OUTPUT
31+ else
32+ echo "changes=true" >> $GITHUB_OUTPUT
33+ fi
34+ else
35+ # First time running, upstream branch doesn't exist yet
36+ echo "changes=true" >> $GITHUB_OUTPUT
37+ fi
38+
39+ - name : Sync if changes exist
40+ if : steps.check.outputs.changes == 'true'
41+ run : |
42+ git checkout -B upstream
43+ git merge upstream/main
44+ git push origin upstream
You can’t perform that action at this time.
0 commit comments