-
Notifications
You must be signed in to change notification settings - Fork 1
44 lines (35 loc) · 1.05 KB
/
sync.yml
File metadata and controls
44 lines (35 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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