Files
Tracker-api/.github/workflows/daily-tracker-sync.yml

31 lines
762 B
YAML

name: Daily Tracker Sync
on:
schedule:
- cron: '0 0 * * *' # 每天凌晨运行
workflow_dispatch: # 允许手动在页面点击“重新运行”
jobs:
update-list:
runs-on: ubuntu-latest
container:
image: node:18-bullseye
options: --user node
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run sync script
run: node sync-trackers.js
- name: Commit and Push
run: |
git config --local user.email "action@gitea.com"
git config --local user.name "Gitea Action"
git add list/
git diff --quiet || (
git commit -m "Update tracker list: $(date +%Y-%m-%d)" &&
git push origin main
)