From 8281d5b38ccc13dfe17bdbf76c7f717a922c68ea Mon Sep 17 00:00:00 2001 From: Howard Askew <19271569+howaskew@users.noreply.github.com> Date: Wed, 28 Oct 2026 11:00:53 +0000 Subject: [PATCH] ci: Remove the previous build before building generated models tsc does not delete output, and lib/ is committed, so compiled files for models that no longer exist stayed in lib/ and were published. After data-models 3.0.11, lib/schema/Quantity and lib/oa/OpportunityAttendanceUpdateSimulateAction remained although their sources were removed. Remove lib/ in the runner before building. If the build or tests fail, the job stops before creating a pull request, so the repository is never left without a lib/. A clean build of the current update differs from the committed lib/ only by those four orphaned files. Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/create-data-model-pr.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/create-data-model-pr.yaml b/.github/workflows/create-data-model-pr.yaml index 3df06ae2..f641d382 100644 --- a/.github/workflows/create-data-model-pr.yaml +++ b/.github/workflows/create-data-model-pr.yaml @@ -67,6 +67,12 @@ jobs: run: npm install working-directory: ./models-ts/ + # tsc never deletes output, so compiled files for removed models would otherwise stay in lib/. + # This only affects the runner's copy: if the build or tests fail, no pull request is created. + - name: Remove previous build + run: rm -rf lib + working-directory: ./models-ts/ + - name: Build models-ts types run: npm run build working-directory: ./models-ts/