53 lines
1.1 KiB
YAML
53 lines
1.1 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: actions/checkout@v7
|
|
|
|
- name: Setup Python
|
|
uses: actions/setup-python@v7
|
|
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
|
|
env:
|
|
RSSHUB_ACCESS_KEY: ${{ secrets.RSSHUB_ACCESS_KEY }}
|
|
|
|
- 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
|