Skip to content

Commit

Permalink
fix(rules): handle blank commit message in signed-off-by check (#4124)
Browse files Browse the repository at this point in the history
Signed-off-by: Default One <setdefaultone@gmail.com>
  • Loading branch information
SetDefaultOne authored Aug 28, 2024
1 parent d4b130a commit 7ab4bab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion @commitlint/rules/src/signed-off-by.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export const signedOffBy: SyncRule<string> = (
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,
Expand Down

0 comments on commit 7ab4bab

Please sign in to comment.