File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,8 +2,8 @@ name: Sync OpenClash_Overwrite Submodule
22
33on :
44 schedule :
5- # 上游通常不是高频更新,每天同步一次即可。
6- - cron : " 41 1 * * *"
5+ # 每 2 小时自动检查并同步一次上游最新 Commit
6+ - cron : " 0 */2 * * *"
77 workflow_dispatch :
88
99permissions :
@@ -27,24 +27,22 @@ jobs:
2727 run : |
2828 submodule_paths=(
2929 "overwrite/OpenClash_Overwrite"
30- "cfg/yaml/OpenClash_Overwrite"
3130 )
3231
33- # .gitmodules 中两个入口均跟踪 main,同步后会指向同一最新提交
32+ # .gitmodules 中跟踪 main,同步后会指向最新提交
3433 git submodule update --init --remote --checkout "${submodule_paths[@]}"
3534
3635 - name : Commit and push if needed
3736 run : |
3837 submodule_paths=(
3938 "overwrite/OpenClash_Overwrite"
40- "cfg/yaml/OpenClash_Overwrite"
4139 )
4240
4341 if [ -n "$(git status --porcelain -- "${submodule_paths[@]}")" ]; then
4442 git config user.name "github-actions[bot]"
4543 git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
4644 git add -- "${submodule_paths[@]}"
47- git commit -m "chore(overwrite): sync OpenClash_Overwrite submodules "
45+ git commit -m "chore(overwrite): sync OpenClash_Overwrite submodule "
4846 # 使用 pull --rebase 防止多人同时 push 导致的冲突
4947 git pull --rebase origin main
5048 git push origin HEAD:main
Original file line number Diff line number Diff line change 22 path = overwrite/OpenClash_Overwrite
33 url = https://github.com/Giveupmoon/OpenClash_Overwrite
44 branch = main
5- [submodule "cfg/yaml/OpenClash_Overwrite "]
6- path = cfg/yaml/OpenClash_Overwrite
7- url = https://github.com/Giveupmoon/OpenClash_Overwrite
8- branch = main
Load diff This file was deleted.
You can’t perform that action at this time.
0 commit comments