Skip to content

Commit 8f07e78

Browse files
committed
update pre-push hook
2 parents 089f7d4 + f222183 commit 8f07e78

1 file changed

Lines changed: 6 additions & 25 deletions

File tree

.github/workflows/sync-branches.yml

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -6,37 +6,18 @@ on:
66
- main
77

88
jobs:
9-
merge-branches:
9+
sync-branches:
1010
runs-on: ubuntu-latest
1111
steps:
1212
- name: Checkout code
13-
uses: actions/checkout@v3
14-
15-
- name: Check Main Branch Status
16-
run: |
17-
local_ref=$(git rev-parse main)
18-
remote_ref=$(git rev-parse origin/main)
19-
if [ "$local_ref" != "$remote_ref" ]; then
20-
echo "HEAD is behind origin/main. Merging..."
21-
git fetch origin/main
22-
git merge origin/main -m "Actions workflow: auto-merge origin/main -> main"
23-
fi
24-
25-
- name: Handle Merge Conflicts
26-
run: |
27-
if [ -n "$(git status --short | grep 'U')" ]; then
28-
echo "Merge conflicts found. Waiting for resolution..."
29-
while [ -n "$(git status --short | grep 'U')" ]; do
30-
sleep 5
31-
done
32-
fi
13+
uses: actions/checkout@v4
3314

3415
- name: Merge Main into Dev
3516
run: |
3617
git switch dev
37-
git merge origin/main -m "Actions workflow: auto-merge main -> dev"
38-
39-
- name: Merge Main into Test
18+
git merge main
19+
20+
- name: Merge main into test
4021
run: |
4122
git switch test
42-
git merge origin/main -m "Actions workflow: auto-merge main -> test"
23+
git merge main

0 commit comments

Comments
 (0)