From e95940d2bcbaa1b864eeaa2d9d9d9da658ca371d Mon Sep 17 00:00:00 2001 From: adminroot Date: Thu, 11 Sep 2025 22:52:56 -0700 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20.gitea/workflows/update-ru?= =?UTF-8?q?les.yml?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitea/workflows/update-rules.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitea/workflows/update-rules.yml b/.gitea/workflows/update-rules.yml index 3e8f4b5..5501e98 100644 --- a/.gitea/workflows/update-rules.yml +++ b/.gitea/workflows/update-rules.yml @@ -13,7 +13,7 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout repository + - name: 检出代码库 uses: actions/checkout@v4 with: token: ${{ secrets.WORKFLOW_TOKEN }} @@ -45,17 +45,17 @@ jobs: echo "=== 文件大小统计 ===" du -h ruleset/* + # 方案1:提交到仓库(推荐) - name: 提交规则文件到仓库 run: | git config --local user.email "action@github.com" git config --local user.name "GitHub Action" git add ruleset/ - git diff --staged --quiet || git commit -m "Update clash rules - $(date +%Y-%m-%d)" - git push - env: - GITHUB_TOKEN: ${{ secrets.WORKFLOW_TOKEN }} + git diff --staged --quiet || git commit -m "Auto update clash rules - $(date +%Y-%m-%d)" + git push https://x-access-token:${{ secrets.WORKFLOW_TOKEN }}@${{ github.server_url }}/${{ github.repository }}.git HEAD:main - - name: 上传规则文件 (备用) + # 方案2:上传为工件(如果需要保留原功能) + - name: 上传规则文件为工件 uses: actions/upload-artifact@v4 with: name: clash-rules-${{ github.run_number }}