Skip to content

fix: handled CRLF line endings in commit subject validation - #64

Merged
ltshb merged 1 commit into
masterfrom
bug/crlf-commit-subject
Nov 5, 2026
Merged

ltshb merged 1 commit into
masterfrom
bug/crlf-commit-subject

Conversation

@ltshb

@ltshb ltshb commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Commits created through GitHub web forms (e.g. commit or "Apply suggestion" dialogs) or Windows editors can have CRLF line endings. Splitting the commit message on \n only left a trailing \r on the subject. The title pattern couldn't match it, so valid commits failed the commit message validation.

The commit message is now split on /\r?\n/, so the subject no longer carries the carriage return.

Port of swissgeo/.github#27.

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-actions github-actions Bot added the bug Something isn't working as expected label Nov 5, 2026
@ltshb
ltshb merged commit c214ff3 into master Nov 5, 2026
5 checks passed
@ltshb
ltshb deleted the bug/crlf-commit-subject branch November 5, 2026 05:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working as expected

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant