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