Files
RSS/.gitea/workflows/update.yml
T

51 lines
1.0 KiB
YAML

name: Update RSS
on:
schedule:
# Gitea Actions 使用 UTC;每 4 小时运行一次。
- cron: "0 */4 * * *"
workflow_dispatch:
push:
paths:
- "feeds.yml"
- "merge.py"
- "requirements.txt"
permissions:
contents: write
jobs:
update:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout
uses: https://gitea.com/actions/checkout@v7
- name: Setup Python
run: |
apt-get install python3 python3-pip -y
python3 -m venv .venv
source .venv/bin/activate
- name: Install dependencies
run: python -m pip install -r requirements.txt
- name: Generate feeds
run: python merge.py
- name: Commit changes
run: |
git config user.name "RSS Bot"
git config user.email "rss-bot@localhost"
git add public/
if git diff --cached --quiet; then
echo "No RSS changes."
exit 0
fi
git commit -m "chore: update RSS feeds"
git push