更新 .gitea/workflows/update-rules.yml
Some checks failed
Download Clash Rules / download-rules (push) Has been cancelled

This commit is contained in:
2025-09-11 22:52:56 -07:00
parent b04c696da9
commit e95940d2bc

View File

@@ -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 }}