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

34 lines
848 B
YAML

name: Daily Tracker Sync
on:
schedule:
- cron: '0 0 * * *' # 每天凌晨运行
workflow_dispatch: # 允许手动在页面点击“重新运行”
jobs:
update-list:
runs-on: docker-linux # 你的 act_runner 标签
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
cache: 'npm'
- 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
)