From 45e8adcd436dca3de1835d377a043de3a34b03fd Mon Sep 17 00:00:00 2001 From: willbot Date: Tue, 18 Aug 2026 10:37:27 +0200 Subject: [PATCH] The engine-version check diffs against the base branch's current tip github.event.pull_request.base.sha is recorded when the pull request is created and goes stale as the base moves. After #200 merged, the check on an unrelated PR diffed across #200's engine changes and failed it. Diffing against origin/ compares only the PR's own changes. Signed-off-by: willbot Signed-off-by: Will Madden --- .github/workflows/test.yml | 7 +++++-- scripts/check-engine-version.mjs | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 7fadabc9..898655d2 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -79,5 +79,8 @@ jobs: - name: The engine version must be new if the engine changed env: - BASE_SHA: ${{ github.event.pull_request.base.sha }} - run: node scripts/check-engine-version.mjs "$BASE_SHA" + # The base branch by name: the event's base.sha is recorded when + # the pull request is created and goes stale as the base moves, + # which blamed other merges' engine changes on unrelated PRs. + BASE_REF: ${{ github.event.pull_request.base.ref }} + run: node scripts/check-engine-version.mjs "origin/$BASE_REF" diff --git a/scripts/check-engine-version.mjs b/scripts/check-engine-version.mjs index 441c6f9c..cc3edd5f 100644 --- a/scripts/check-engine-version.mjs +++ b/scripts/check-engine-version.mjs @@ -7,7 +7,7 @@ // `npx prisma@next` crashed on import. The registry is immutable, so a // changed engine must claim a new version (`pnpm bump-cli-engine-version`). // -// Usage: node scripts/check-engine-version.mjs +// Usage: node scripts/check-engine-version.mjs import { execFile } from "node:child_process"; import { readFileSync } from "node:fs"; @@ -52,7 +52,7 @@ export function engineBumpVerdict({ async function main() { const baseSha = process.argv[2]; if (!baseSha) { - console.error("Usage: node scripts/check-engine-version.mjs "); + console.error("Usage: node scripts/check-engine-version.mjs "); process.exit(1); }