From b78687263dad5ea92efef9d400c4626d73d4c2be Mon Sep 17 00:00:00 2001 From: "John D. Swanson" Date: Thu, 19 Mar 2026 14:26:40 -0400 Subject: [PATCH] Fix guided tour false positive in PR size check (#51964) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Context The size check workflow's guided tour detection matches text inside HTML comment placeholders in the PR template (e.g., ``), producing false positives like the one on #51957. Fix: strip `` comments from the PR body before running the regex. ## How to Review - Single file: `.github/workflows/pr-size-check.yml`, lines 148-151 - The `.replace(//g, '')` runs in `actions/github-script` JS, not shell ## Self-Review Checklist - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Release Notes: - N/A --- .github/workflows/pr-size-check.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-size-check.yml b/.github/workflows/pr-size-check.yml index 940c619e0cfd308728b24c42264a580d6e93592c..bbd60d727e1e7689c11ce9b2d2583b2e2e506fad 100644 --- a/.github/workflows/pr-size-check.yml +++ b/.github/workflows/pr-size-check.yml @@ -144,7 +144,11 @@ jobs: const alreadyCommented = comments.some(c => c.body.includes(MARKER)); if (!alreadyCommented) { - const prBody = context.payload.pull_request.body || ''; + // Strip HTML comments before checking — the PR template's + // placeholder text contains "guided tour" and "read in order" + // which causes false positives. + const prBody = (context.payload.pull_request.body || '') + .replace(//g, ''); const guidedTourPresent = /how to review|guided tour|read.*in.*order/i.test(prBody); let body = `${MARKER}\n`;