Skip to content

Commit 7ab4bab

Browse files
fix(rules): handle blank commit message in signed-off-by check (#4124)
Signed-off-by: Default One <[email protected]>
1 parent d4b130a commit 7ab4bab

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

@commitlint/rules/src/signed-off-by.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ export const signedOffBy: SyncRule<string> = (
1818
const last = lines[lines.length - 1];
1919

2020
const negated = when === 'never';
21-
const hasSignedOffBy = last.startsWith(value);
21+
const hasSignedOffBy =
22+
// empty commit message
23+
last ? last.startsWith(value) : false;
2224

2325
return [
2426
negated ? !hasSignedOffBy : hasSignedOffBy,

0 commit comments

Comments
 (0)