Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(rules): handle blank commit message in signed-off-by rule #4124

Merged
merged 1 commit into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(rules): handle blank commit message in signed-off-by check
Signed-off-by: Default One <setdefaultone@gmail.com>
  • Loading branch information
SetDefaultOne committed Aug 28, 2024
commit 765d26f5ae3960046586183e04e5810746c55aea
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