Skip to content

Commit f1ce870

Browse files
committed
ci: add schema validation check to GitHub Actions workflow
Add a new job \`schema-check\` to verify that generated JSON schema files are up-to-date This job will: - Generate schema files using \`bun run generate:schema\` - Check if any changes were made using \`git diff\` - Fail the CI if schema files are outdated This ensures developers remember to regenerate and commit schema files when making changes to command arguments
1 parent 63e90c3 commit f1ce870

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,28 @@ jobs:
5454
- uses: crate-ci/typos@master
5555
with:
5656
config: ./typos.toml
57+
58+
schema-check:
59+
runs-on: ubuntu-latest
60+
steps:
61+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
62+
- uses: oven-sh/setup-bun@735343b667d3e6f658f44d0eca948eb6282f2b76 # v2.0.2
63+
with:
64+
bun-version: latest
65+
- run: bun install --frozen-lockfile
66+
- name: Generate schema files
67+
run: bun run generate:schema
68+
- name: Check if schema files are up-to-date
69+
run: |
70+
if git diff --exit-code config-schema.json docs/public/config-schema.json; then
71+
echo "✅ Schema files are up-to-date"
72+
else
73+
echo "❌ Schema files are not up-to-date. Please run 'bun run generate:schema' and commit the changes."
74+
echo ""
75+
echo "Changed files:"
76+
git diff --name-only config-schema.json docs/public/config-schema.json
77+
echo ""
78+
echo "Diff:"
79+
git diff config-schema.json docs/public/config-schema.json
80+
exit 1
81+
fi

0 commit comments

Comments
 (0)