更新 .gitea/workflows/update-rules.yml
Some checks failed
Download Clash Rules / download-rules (push) Failing after 33s

This commit is contained in:
2025-09-11 23:16:25 -07:00
parent 323b9ab0f3
commit 587bb4dc75

View File

@@ -1,39 +1,24 @@
name: Download and Push File name: Download Clash Rules
on: on:
push:
branches: [ main ]
workflow_dispatch: workflow_dispatch:
push:
branches: [ main, master ]
jobs: jobs:
download-and-push: download-rules:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
# 1. 检出仓库 - uses: actions/checkout@v3
- name: Checkout repository
uses: actions/checkout@v3
with:
token: ${{ secrets.GITEA_TOKEN }} # 或使用 ${{ github.token }}
# 2. 配置 Git - run: |
- name: Configure Git git config user.name "Bot"
run: | git config user.email "bot@example.com"
git config --local user.email "action@gitea.local"
git config --local user.name "Gitea Action"
# 3. 下载文件(示例) mkdir -p ruleset
- name: Download file echo "test" > ruleset/test.txt
run: |
curl -o downloaded_file.txt https://example.com/file.txt
# 或者使用 wget
# wget https://example.com/file.txt -O downloaded_file.txt
# 4. 添加文件到 Git git add .
- name: Add file to git git commit -m "Test commit" || echo "No changes"
run: | git push || echo "Push failed"
git add downloaded_file.txt
git commit -m "Add downloaded file via workflow"
# 5. 推送到仓库
- name: Push changes
run: |
git push origin main