forked from ultraworkers/claw-code
-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (44 loc) · 1.38 KB
/
upstream-sync.yml
File metadata and controls
52 lines (44 loc) · 1.38 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
name: Sync Upstream
on:
schedule:
- cron: '0 */6 * * *' # Every 6 hours
workflow_dispatch:
jobs:
sync:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
ref: dev
fetch-depth: 0
- name: Configure git
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
- name: Add upstream and fetch
run: |
git remote add upstream https://github.com/ultraworkers/claw-code.git
git fetch upstream main
- name: Check for new commits
id: check
run: |
BEHIND=$(git rev-list --count dev..upstream/main)
echo "behind=$BEHIND" >> $GITHUB_OUTPUT
echo "$BEHIND new commits from upstream"
- name: Merge upstream into dev
if: steps.check.outputs.behind != '0'
run: |
# Try clean merge first
if git merge upstream/main --no-edit; then
echo "Clean merge — no conflicts"
else
echo "Conflicts found — resolving with ours strategy (keeping our changes)"
git merge --abort
git merge upstream/main --no-edit -X ours
fi
- name: Push to dev
if: steps.check.outputs.behind != '0'
run: |
git push origin dev