Skip to content

Commit fcfd9ed

Browse files
authored
Add workflow to sync fork with upstream repository
1 parent 4bbf6ec commit fcfd9ed

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Sync Fork with Upstream
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout Fork
13+
uses: actions/checkout@v4
14+
with:
15+
token: ${{ secrets.GITHUB_TOKEN }}
16+
fetch-depth: 0
17+
18+
- name: Sync with Upstream
19+
run: |
20+
git config user.name "github-actions[bot]"
21+
git config user.email "github-actions[bot]@users.noreply.github.com"
22+
23+
# 添加上游仓库
24+
git remote add upstream https://github.com/Fanju6/NetProxy-Magisk.git
25+
git fetch upstream
26+
27+
# 合并上游 main 分支
28+
git checkout main
29+
git merge upstream/main --no-edit
30+
31+
# 推送到 Fork
32+
git push origin main

0 commit comments

Comments
 (0)