Skip to content

Commit f71cfcf

Browse files
committed
feat: add ci step for generate-config-types check
1 parent d665faf commit f71cfcf

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

.github/workflows/lint.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,11 @@ jobs:
3838
3939
- name: Check formatting
4040
run: npm run format:check
41+
42+
- name: Check generated config types are up-to-date
43+
run: |
44+
npm run generate-config-types
45+
if ! git diff --exit-code src/config/generated/config.ts; then
46+
echo "Generated config types are out of date. Run 'npm run generate-config-types' locally and commit the changes."
47+
exit 1
48+
fi

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"clientinstall": "npm install --prefix client",
99
"server": "tsx index.ts",
1010
"start": "concurrently \"npm run server\" \"npm run client\"",
11-
"build": "npm run build-ui && npm run build-lib",
11+
"build": "npm run generate-config-types && npm run build-ui && npm run build-lib",
1212
"build-ts": "tsc",
1313
"build-ui": "vite build",
1414
"build-lib": "./scripts/build-for-publish.sh",
@@ -26,7 +26,7 @@
2626
"gen-schema-doc": "node ./scripts/doc-schema.js",
2727
"cypress:run": "cypress run",
2828
"cypress:open": "cypress open",
29-
"generate-types": "quicktype --src-lang schema --lang typescript --out src/config/generated/config.ts --top-level GitProxyConfig config.schema.json && ts-node scripts/add-banner.ts src/config/generated/config.ts"
29+
"generate-config-types": "quicktype --src-lang schema --lang typescript --out src/config/generated/config.ts --top-level GitProxyConfig config.schema.json && ts-node scripts/add-banner.ts src/config/generated/config.ts"
3030
},
3131
"bin": {
3232
"git-proxy": "./index.js",

0 commit comments

Comments
 (0)