更新 .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:
|
||||
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
|
||||
|
||||
# 2. 配置 Git
|
||||
- name: Configure Git
|
||||
run: |
|
||||
git config --local user.email "action@gitea.local"
|
||||
git config --local user.name "Gitea Action"
|
||||
- run: |
|
||||
git config user.name "Bot"
|
||||
git config user.email "bot@example.com"
|
||||
|
||||
# 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
|
||||
mkdir -p ruleset
|
||||
echo "test" > ruleset/test.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
|
||||
git add .
|
||||
git commit -m "Test commit" || echo "No changes"
|
||||
git push || echo "Push failed"
|
||||
Reference in New Issue
Block a user