From 2555f2c10d95ff9d2ce6232865f95c8fb3bbd7b2 Mon Sep 17 00:00:00 2001 From: starsswp Date: Sun, 23 Nov 2025 14:22:01 +0000 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20.gitea/workflows/sync.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/sync.yml | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .gitea/workflows/sync.yml diff --git a/.gitea/workflows/sync.yml b/.gitea/workflows/sync.yml new file mode 100644 index 0000000..da87f43 --- /dev/null +++ b/.gitea/workflows/sync.yml @@ -0,0 +1,37 @@ +name: Sync Shadowrocket Rules From GitHub + +on: + schedule: + - cron: '0 */2 * * *' # 每 2 小时同步一次 + workflow_dispatch: # 支持手动同步 + +jobs: + sync: + runs-on: ubuntu-latest + + steps: + - name: Checkout Gitea repo + uses: actions/checkout@v4 + + - name: Download sr_direct_list.module + run: | + curl -L \ + https://raw.githubusercontent.com/GMOogway/shadowrocket-rules/master/sr_direct_list.module \ + -o sr_direct_list.module + + - name: Download sr_proxy_list.module + run: | + curl -L \ + https://raw.githubusercontent.com/GMOogway/shadowrocket-rules/master/sr_proxy_list.module \ + -o sr_proxy_list.module + + - name: Commit changes + run: | + git config user.name "gitea-bot" + git config user.email "bot@gitea.local" + git add sr_direct_list.module sr_proxy_list.module + git commit -m "sync: update shadowrocket rules from GitHub" || true + + - name: Push changes + run: | + git push origin HEAD