From 33640ed453681efd7ebadeaacc458ae5ce077c96 Mon Sep 17 00:00:00 2001 From: Brice Schaffner Date: Thu, 5 Nov 2026 06:26:05 +0100 Subject: [PATCH] fix: handled CRLF line endings in commit subject validation Commits created through GitHub web forms (e.g. commit or "Apply suggestion" dialogs) or Windows editors can have CRLF line endings. Splitting the message on "\n" only left a trailing "\r" on the subject, which the title pattern could not match, so valid commits failed the PR content check. The commit message is now split on /\r?\n/, so the extracted subject no longer carries the carriage return. --- .github/workflows/pr-content.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/pr-content.yml b/.github/workflows/pr-content.yml index 1d28148..22f09f9 100644 --- a/.github/workflows/pr-content.yml +++ b/.github/workflows/pr-content.yml @@ -133,7 +133,7 @@ jobs: const invalidCommits = commits .map((commit) => ({ sha: commit.sha, - subject: commit.commit.message.split("\n")[0], + subject: commit.commit.message.split(/\r?\n/)[0], isMerge: commit.parents.length > 1, })) .filter(({ subject, isMerge }) => !isMerge && !titlePattern.test(subject));