diff --git a/@commitlint/rules/src/signed-off-by.ts b/@commitlint/rules/src/signed-off-by.ts index 674a206197..0a30c03e23 100644 --- a/@commitlint/rules/src/signed-off-by.ts +++ b/@commitlint/rules/src/signed-off-by.ts @@ -18,7 +18,9 @@ export const signedOffBy: SyncRule = ( const last = lines[lines.length - 1]; const negated = when === 'never'; - const hasSignedOffBy = last.startsWith(value); + const hasSignedOffBy = + // empty commit message + last ? last.startsWith(value) : false; return [ negated ? !hasSignedOffBy : hasSignedOffBy,