Skip to content
Source
Sign inSign up
TanStack/schemas
Open History to see the last commit

catalog-mirror.yml

49 lines1.6 KB

1# Copy to .github/workflows/catalog-mirror.yml in the public data repo
2# (issue #343). Needs the repo secret MODELSCHEMAS_ADMIN_KEY. Hourly: the
3# 15-minute poll would mostly produce empty runs.
4name: Catalog mirror
5​
6on:
7 schedule:
8 - cron: '23 * * * *'
9 workflow_dispatch:
10​
11permissions:
12 contents: write
13​
14concurrency:
15 group: catalog-mirror
16 cancel-in-progress: false
17​
18jobs:
19 mirror:
20 runs-on: ubuntu-latest
21 timeout-minutes: 15
22 steps:
23 - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
24 - name: Fetch the mirror script
25 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
26 with:
27 repository: TanStack/modelschemas
28 path: .modelschemas
29 persist-credentials: false
30 sparse-checkout: scripts/mirror-catalog.ts
31 sparse-checkout-cone-mode: false
32 - uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
33 with:
34 node-version: 24
35 - name: Write the catalog files
36 env:
37 MODELSCHEMAS_ADMIN_KEY: ${{ secrets.MODELSCHEMAS_ADMIN_KEY }}
38 run: node .modelschemas/scripts/mirror-catalog.ts . > "$RUNNER_TEMP/commit-msg"
39 - name: Commit only on change
40 run: |
41 git add -A providers models schemas feed.json
42 if git diff --cached --quiet; then
43 echo "Catalog unchanged; nothing to commit."
44 exit 0
45 fi
46 git config user.name 'github-actions[bot]'
47 git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
48 git commit --quiet -F "$RUNNER_TEMP/commit-msg"
49 git push