Skip to content

Commit bd5a94a

Browse files
committed
Avoid false-postive matching of the commit 'type' field by updating the regex to only match non-whitespace characters up until the first colon.
1 parent 27a685b commit bd5a94a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/commitlint-github-utils/src/commitlintGitHubConstants.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const ISSUE_NUMBER_PATTERN = /^#(?<issueNumber>\d+)$/;
2727

2828
// Exclude matching 'WIP' as the start of a description using a negative look-ahead
2929
// Instead should match WIP_WITH_JUST_ISSUE_NUMBERS_PATTERN below
30-
export const ISSUE_NUMBERS_PATTERN = /^\((?<issues>.*?)\)(?: (?<type>.+?):)?(?!\s*WIP)(?<description>.*)/;
30+
export const ISSUE_NUMBERS_PATTERN = /^\((?<issues>.*?)\)(?: (?<type>\S+?):)?(?!\s*WIP)(?<description>.*)/;
3131

3232
// Allow WIPs to avoid specifying issue number as should only exist on feature branches which are per issue
3333
// Allow either 'WIP: ...', 'WIP - ...', 'WIP2', 'WIP 2', 'WIP 2: ...', 'WIP 2 - ...' etc.

0 commit comments

Comments
 (0)