Skip to content

Commit

Permalink
Throw error if no commit is annotated with a changelog entry
Browse files Browse the repository at this point in the history
Change-type: patch
Signed-off-by: Giovanni Garufi <giovanni@balena.io>
Changelog-entry: Throw error if no commit is annotated with a changelog entry
  • Loading branch information
nazrhom committed Feb 27, 2019
1 parent 759722b commit caeb84f
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions versionist.conf.js
Expand Up @@ -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'])) {
Expand All @@ -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'
})
Expand Down

0 comments on commit caeb84f

Please sign in to comment.