更新 .gitea/workflows/update-rules.yml
Some checks failed
Download Clash Rules / download-rules (push) Failing after 33s
Some checks failed
Download Clash Rules / download-rules (push) Failing after 33s
This commit is contained in:
@@ -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
|
- run: |
|
||||||
with:
|
git config user.name "Bot"
|
||||||
token: ${{ secrets.GITEA_TOKEN }} # 或使用 ${{ github.token }}
|
git config user.email "bot@example.com"
|
||||||
|
|
||||||
# 2. 配置 Git
|
mkdir -p ruleset
|
||||||
- name: Configure Git
|
echo "test" > ruleset/test.txt
|
||||||
run: |
|
|
||||||
git config --local user.email "action@gitea.local"
|
|
||||||
git config --local user.name "Gitea Action"
|
|
||||||
|
|
||||||
# 3. 下载文件(示例)
|
git add .
|
||||||
- name: Download file
|
git commit -m "Test commit" || echo "No changes"
|
||||||
run: |
|
git push || echo "Push failed"
|
||||||
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
|
|
||||||
Reference in New Issue
Block a user