From 120ed9acfa487568e39ef529d5390d40d7170972 Mon Sep 17 00:00:00 2001 From: fengyuzhe Date: Sat, 9 May 2026 11:36:45 +0800 Subject: [PATCH 1/2] Fix: use env variable for PR title in DTS API compatibility check --- .github/workflows/pr-test.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index 465846d9f..a679a1944 100644 --- a/.github/workflows/pr-test.yml +++ b/.github/workflows/pr-test.yml @@ -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." From 2b5fbbf3361ff1135c164167e45a04d581da9d6f Mon Sep 17 00:00:00 2001 From: fengyuzhe Date: Sat, 9 May 2026 12:02:01 +0800 Subject: [PATCH 2/2] refine --- .github/workflows/pr-test.yml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pr-test.yml b/.github/workflows/pr-test.yml index a679a1944..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 diff --git a/package.json b/package.json index c03081f27..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", + "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",