Skip to content

Commit 632bc30

Browse files
authored
test auto sync
1 parent ad53a34 commit 632bc30

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

.github/workflows/syn_upstream.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Sync Upstream
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * 0' # Every Sunday at midnight
6+
7+
jobs:
8+
merge:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout master branch
12+
uses: actions/checkout@v2
13+
with:
14+
ref: master
15+
16+
- name: Merge upstream master
17+
id: merge
18+
run: |
19+
git remote add upstream https://github.com/ggml-org/repository.git
20+
git fetch upstream
21+
if git merge upstream/master; then
22+
echo "merge_success=true" >> $GITHUB_OUTPUT
23+
else
24+
echo "merge_success=false" >> $GITHUB_OUTPUT
25+
echo "Automatic merge failed. Skipping push."
26+
exit 0
27+
fi
28+
29+
- name: Push changes
30+
if: steps.merge.outputs.merge_success == 'true'
31+
run: |
32+
# Check if there are any changes
33+
if git diff --quiet HEAD@{1} HEAD; then
34+
echo "No changes to push"
35+
else
36+
echo "Changes detected, pushing updates..."
37+
git push origin master
38+
fi
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)