Skip to content

Commit b293d80

Browse files
committed
ci: add schema drift check to PR quality gates
1 parent 7a70cf4 commit b293d80

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/lint.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,3 +100,28 @@ jobs:
100100
path: node_modules
101101
key: node-modules-${{ hashFiles('package-lock.json') }}
102102
- run: npm run typecheck
103+
104+
schema-check:
105+
needs: setup
106+
if: ${{ !startsWith(github.head_ref, 'release/') }}
107+
runs-on: ubuntu-latest
108+
steps:
109+
- uses: actions/checkout@v6
110+
- uses: actions/setup-node@v6
111+
with:
112+
node-version: 20.x
113+
- uses: actions/cache/restore@v5
114+
with:
115+
path: node_modules
116+
key: node-modules-${{ hashFiles('package-lock.json') }}
117+
- run: npm run build
118+
- run: node scripts/generate-schema.mjs
119+
- name: Check for schema drift
120+
run: |
121+
if ! git diff --exit-code schemas/; then
122+
echo ""
123+
echo "❌ JSON schema is out of date with Zod source schemas."
124+
echo "Run 'npm run build && node scripts/generate-schema.mjs' and commit the result."
125+
exit 1
126+
fi
127+
echo "✓ JSON schema is up to date"

0 commit comments

Comments
 (0)