Skip to content

Commit baf4ade

Browse files
authored
ci: regenerate frontend api.ts and gate on OpenAPI spec drift (#438)
The backend-ci already exports the spec and gates on openapi.json drift, but the generated frontend types (api.ts) could silently diverge. This adds a 'Regenerate frontend client types' step and updates the drift check to cover both openapi.json and api.ts. Closes #434 Co-authored-by: temiport25 <temiport25@users.noreply.github.com>
1 parent 272dfe4 commit baf4ade

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

.github/workflows/backend-ci.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,14 @@ jobs:
8686
NODE_ENV: development
8787
run: npm run spec:export
8888

89+
- name: Regenerate frontend client types
90+
working-directory: app/frontend
91+
run: pnpm generate:api
92+
8993
- name: Check for Prisma schema without migration
9094
run: chmod +x app/backend/scripts/check-prisma-migration.sh && app/backend/scripts/check-prisma-migration.sh
9195

9296
- name: Check for OpenAPI spec drift
9397
run: |
94-
git diff --exit-code app/frontend/openapi.json || \
95-
(echo "ERROR: openapi.json is out of date. Run 'npm run spec:export' in app/backend and commit app/frontend/openapi.json." && exit 1)
98+
git diff --exit-code app/frontend/openapi.json app/frontend/src/lib/generated/api.ts || \
99+
(echo "ERROR: openapi.json or api.ts is out of date. Run 'npm run spec:export' in app/backend, then 'pnpm generate:api' in app/frontend, and commit both files." && exit 1)

0 commit comments

Comments
 (0)