From 587bb4dc7561a609cb0d6293ff9487e5433269cf Mon Sep 17 00:00:00 2001 From: adminroot Date: Thu, 11 Sep 2025 23:16:25 -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 | 47 +++++++++++-------------------- 1 file changed, 16 insertions(+), 31 deletions(-) diff --git a/.gitea/workflows/update-rules.yml b/.gitea/workflows/update-rules.yml index a739c74..7e8f3e6 100644 --- a/.gitea/workflows/update-rules.yml +++ b/.gitea/workflows/update-rules.yml @@ -1,39 +1,24 @@ -name: Download and Push File +name: Download Clash Rules + on: - push: - branches: [ main ] workflow_dispatch: + push: + branches: [ main, master ] jobs: - download-and-push: + download-rules: runs-on: ubuntu-latest + steps: - # 1. 检出仓库 - - name: Checkout repository - uses: actions/checkout@v3 - with: - token: ${{ secrets.GITEA_TOKEN }} # 或使用 ${{ github.token }} + - uses: actions/checkout@v3 + + - run: | + git config user.name "Bot" + git config user.email "bot@example.com" - # 2. 配置 Git - - name: Configure Git - run: | - git config --local user.email "action@gitea.local" - git config --local user.name "Gitea Action" + mkdir -p ruleset + echo "test" > ruleset/test.txt - # 3. 下载文件(示例) - - name: Download file - run: | - curl -o downloaded_file.txt https://example.com/file.txt - # 或者使用 wget - # wget https://example.com/file.txt -O downloaded_file.txt - - # 4. 添加文件到 Git - - name: Add file to git - run: | - git add downloaded_file.txt - git commit -m "Add downloaded file via workflow" - - # 5. 推送到仓库 - - name: Push changes - run: | - git push origin main \ No newline at end of file + git add . + git commit -m "Test commit" || echo "No changes" + git push || echo "Push failed" \ No newline at end of file