Skip to content

Commit d4c7bb7

Browse files
The engine-version check diffs against the base branch's current tip (#206)
The check added in #200 diffed against `github.event.pull_request.base.sha`, which is recorded at PR creation and goes stale as the base branch moves. After #200 merged, the check on #201 — a PR that does not touch the engine — diffed across #200's own engine changes and failed. Diffing against `origin/<base ref>` (the checkout has full history) compares only the PR's changes. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: willbot <w.a.madden+machine@gmail.com> Signed-off-by: Will Madden <madden@prisma.io>
1 parent dc99c6d commit d4c7bb7

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

.github/workflows/test.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,8 @@ jobs:
7979

8080
- name: The engine version must be new if the engine changed
8181
env:
82-
BASE_SHA: ${{ github.event.pull_request.base.sha }}
83-
run: node scripts/check-engine-version.mjs "$BASE_SHA"
82+
# The base branch by name: the event's base.sha is recorded when
83+
# the pull request is created and goes stale as the base moves,
84+
# which blamed other merges' engine changes on unrelated PRs.
85+
BASE_REF: ${{ github.event.pull_request.base.ref }}
86+
run: node scripts/check-engine-version.mjs "origin/$BASE_REF"

scripts/check-engine-version.mjs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// `npx prisma@next` crashed on import. The registry is immutable, so a
88
// changed engine must claim a new version (`pnpm bump-cli-engine-version`).
99
//
10-
// Usage: node scripts/check-engine-version.mjs <base-sha>
10+
// Usage: node scripts/check-engine-version.mjs <base-ref>
1111

1212
import { execFile } from "node:child_process";
1313
import { readFileSync } from "node:fs";
@@ -52,7 +52,7 @@ export function engineBumpVerdict({
5252
async function main() {
5353
const baseSha = process.argv[2];
5454
if (!baseSha) {
55-
console.error("Usage: node scripts/check-engine-version.mjs <base-sha>");
55+
console.error("Usage: node scripts/check-engine-version.mjs <base-ref>");
5656
process.exit(1);
5757
}
5858

0 commit comments

Comments
 (0)