@@ -0,0 +1,50 @@
|
||||
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: actions/checkout@v4
|
||||
|
||||
- name: Setup Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: "3.13"
|
||||
cache: pip
|
||||
|
||||
- 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
|
||||
Reference in New Issue
Block a user