Skip to content

Sync Models from models.dev #7

Sync Models from models.dev

Sync Models from models.dev #7

Workflow file for this run

name: Sync Models from models.dev
on:
schedule:
# 每天 UTC 时间 0:00 运行
- cron: '0 0 * * *'
workflow_dispatch:
# 允许手动触发
jobs:
sync:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install dependencies
run: npm install
- name: Sync models from models.dev
run: npm run sync
- name: Validate data
run: npm run validate
- name: Check for changes
id: changes
run: |
git diff --quiet || echo "changes=true" >> $GITHUB_OUTPUT
- name: Commit and push changes
if: steps.changes.outputs.changes == 'true'
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add -A
git commit -m "chore: sync models from models.dev [skip ci]"
git push