forked from supabase/realtime
-
Notifications
You must be signed in to change notification settings - Fork 0
66 lines (55 loc) · 2.02 KB
/
upsteam-sync.yml
File metadata and controls
66 lines (55 loc) · 2.02 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
name: Sync with upstream
on:
workflow_dispatch:
schedule:
- cron: '0 6 * * *'
jobs:
repo-sync:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: repo-sync
id: sync
uses: repo-sync/github-sync@7c8493e95237362ad417495e8512c37e78d25f19
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
source_repo: "https://github.com/supabase/realtime"
source_branch: "main"
destination_branch: "upstream-main"
sync_tags: ""
github_token: ${{ secrets.UNITY_PAT }}
- name: Create Pull Request from console
env:
GH_TOKEN: ${{ secrets.UNITY_PAT }}
run: |
# Check if PR already exists with this title
PR_TITLE="🔄 Sync with upstream changes"
EXISTING_PR=$(gh pr list --base main --state open --json title --jq ".[] | select(.title == \"$PR_TITLE\") | .title")
if [ -n "$EXISTING_PR" ]; then
echo "PR with title '$PR_TITLE' already exists. Skipping PR creation."
else
echo "No existing PR found. Creating new PR..."
# Create PR body
PR_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*"
gh pr create \
--base main \
--head upstream-main \
--title "$PR_TITLE" \
--body "$PR_BODY"
fi