From 3ec4052c24d29955c1cbf75b7cffb4fa880a135c Mon Sep 17 00:00:00 2001 From: Dorae <86833913+Toperlock@users.noreply.github.com> Date: Sun, 31 Dec 2023 17:08:59 +0800 Subject: [PATCH] Update sync.yml --- .github/workflows/sync.yml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/sync.yml b/.github/workflows/sync.yml index 427005bef..6e7d7c7be 100644 --- a/.github/workflows/sync.yml +++ b/.github/workflows/sync.yml @@ -13,6 +13,13 @@ jobs: steps: - uses: actions/checkout@v2 + - name: "Setup sing-box" + env: + SING_BOX_DEB_URL: "https://github.com/SagerNet/sing-box/releases/download/v1.8.0-rc.7/sing-box_1.8.0-rc.7_linux_amd64.deb" + run: | + set -Eeuo pipefail + wget -O sing-box.deb $SING_BOX_DEB_URL + sudo dpkg -i sing-box.deb - name: Set up Python3 uses: actions/setup-python@v2 with: @@ -29,5 +36,13 @@ jobs: git config --global user.email "action@github.com" git config --global user.name "GitHub Action" git add ./rule/*.json - git commit -m "Add JSON files" - git push + git add ./rule/*.srs + + # 检查是否有文件被修改 + if git diff --staged --quiet; then + echo "No changes to commit" + exit 0 + else + git commit -m "Update rules" + git push + fi