From dccd92dc48cac50960fe807807687a7007ad99a8 Mon Sep 17 00:00:00 2001 From: temiport25 Date: Thu, 20 Aug 2026 12:19:16 +0100 Subject: [PATCH] ci: regenerate frontend api.ts and gate on OpenAPI spec drift 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 --- .github/workflows/backend-ci.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/backend-ci.yml b/.github/workflows/backend-ci.yml index 5ac9a441..450ed638 100644 --- a/.github/workflows/backend-ci.yml +++ b/.github/workflows/backend-ci.yml @@ -86,10 +86,14 @@ jobs: NODE_ENV: development run: npm run spec:export + - name: Regenerate frontend client types + working-directory: app/frontend + run: pnpm generate:api + - name: Check for Prisma schema without migration run: chmod +x app/backend/scripts/check-prisma-migration.sh && app/backend/scripts/check-prisma-migration.sh - name: Check for OpenAPI spec drift run: | - git diff --exit-code app/frontend/openapi.json || \ - (echo "ERROR: openapi.json is out of date. Run 'npm run spec:export' in app/backend and commit app/frontend/openapi.json." && exit 1) + git diff --exit-code app/frontend/openapi.json app/frontend/src/lib/generated/api.ts || \ + (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)