From b725e7abb1fe5cccd3aef894f49e7a1537e921b8 Mon Sep 17 00:00:00 2001 From: along Date: Tue, 21 Jul 2026 15:13:45 -0700 Subject: [PATCH] ci: tolerate CRLF line endings in pr-issue-check The ## Issues section detector matched `^##[ \t]+Issues[ \t]*\n`, which requires a bare LF after the heading. GitHub stores PR bodies with CRLF line endings (web UI edits and bot edits such as automated summaries), so on those bodies the `\r` before the `\n` made the regex miss the section and the check failed with "PR body is missing a visible ## Issues section" even when a valid `Closes #NNN` reference was present. Normalize the body's newlines to LF once before matching. This fixes the false negative without loosening any of the reference, NO-REF, disallowed tracker, or disallowed URL checks. Signed-off-by: along --- ci/check-pr-issue.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/check-pr-issue.sh b/ci/check-pr-issue.sh index 67e69ca2d..470aeb7da 100755 --- a/ci/check-pr-issue.sh +++ b/ci/check-pr-issue.sh @@ -36,6 +36,10 @@ if repo.lower() != "nvidia/nvcf": sys.exit(1) body = os.environ.get("PR_BODY", "") +# GitHub stores PR bodies with CRLF line endings (web UI and bot edits), so +# normalize to LF before matching; the ## Issues heading regex expects a bare +# newline and would otherwise fail to find the section on a CRLF body. +body = body.replace("\r\n", "\n").replace("\r", "\n") visible = re.sub(r"|$)", "", body, flags=re.S) section_match = re.search(