diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 465846d9f..9c7968113 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -45,7 +45,7 @@ jobs: - name: Generate DTS shell: bash - run: npm run generate:dts + run: npx tsx workflow/generate-dts.ts - name: Run unit tests id: unit-tests @@ -54,6 +54,8 @@ jobs: - name: Check DTS API compatibility if: github.event_name == 'pull_request' shell: bash + env: + PR_TITLE: ${{ github.event.pull_request.title }} run: | BASE_REF="origin/${{ github.base_ref }}" SNAP_FILE="tests/__snapshots__/dts-snapshot.test.ts.snap" @@ -66,7 +68,6 @@ jobs: # Check if snapshot file changed compared to base branch if git diff --name-only "$BASE_REF"...HEAD | grep -q "$SNAP_FILE"; then - PR_TITLE="${{ github.event.pull_request.title }}" if [[ "$PR_TITLE" != *"[break]"* ]]; then echo "::error::DTS API breaking change detected! The snapshot file changed but the PR title does not contain [break]." echo "::error::If this change is intentional, add [break] to your PR title." diff --git a/package.json b/package.json index 5165f9f67..e7fbc6942 100644 --- a/package.json +++ b/package.json @@ -27,7 +27,7 @@ "check:e2e-coverage": "tsx e2e/scripts/check-coverage.ts", "check:e2e-coverage:report": "tsx e2e/scripts/check-coverage.ts --save", "generate:mcp-types": "node --max-old-space-size=4096 node_modules/tsx/dist/cli.mjs e2e/scripts/generate-mcp-types.ts", - "generate:dts": "tsx workflow/generate-dts.ts & npx jest tests/dts-snapshot.test.ts -u", + "generate:dts": "tsx workflow/generate-dts.ts && npx jest tests/dts-snapshot.test.ts -u", "install:engine": "cd ./packages/engine && npm i", "compiler": "FORCE_UPDATE=true npm i", "compiler:engine": "node --max-old-space-size=8192 workflow/compiler-engine.js --force",