From caeb84f58bc2286d0b004ad8d219302c77979c14 Mon Sep 17 00:00:00 2001 From: Giovanni Garufi Date: Wed, 27 Feb 2019 16:22:29 +0100 Subject: [PATCH] Throw error if no commit is annotated with a changelog entry Change-type: patch Signed-off-by: Giovanni Garufi Changelog-entry: Throw error if no commit is annotated with a changelog entry --- versionist.conf.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/versionist.conf.js b/versionist.conf.js index dd1d5ad0..a3ecb8db 100644 --- a/versionist.conf.js +++ b/versionist.conf.js @@ -31,9 +31,7 @@ module.exports = { fromLine: 5 }, - includeCommitWhen: (commit) => { - return commit.footer['Changelog-entry'] - }, + includeCommitWhen: 'has-changelog-entry', getIncrementLevelFromCommit: (commit) => { if (/none/i.test(commit.footer['Change-type'])) { @@ -44,6 +42,9 @@ module.exports = { }, transformTemplateData: (data) => { + if (data.commits.length === 0) { + throw new Error('No commits annotated with Changelog-entry') + } data.features = data.commits.filter((commit) => { return commit.subject.type === 'feat' })