diff --git a/src/changelog-notes/default.ts b/src/changelog-notes/default.ts index f98ad5e46..9f556bde0 100644 --- a/src/changelog-notes/default.ts +++ b/src/changelog-notes/default.ts @@ -73,35 +73,40 @@ export class DefaultChangelogNotes implements ChangelogNotes { this.headerPartial || preset.writerOpts.headerPartial; preset.writerOpts.mainTemplate = this.mainTemplate || preset.writerOpts.mainTemplate; - const changelogCommits = commits.map(commit => { - const notes = commit.notes - .filter(note => note.title === 'BREAKING CHANGE') - .map(note => - replaceIssueLink( - note, - context.host, - context.owner, - context.repository - ) - ); - return { - body: '', // commit.body, - subject: htmlEscape(commit.bareMessage), - type: commit.type, - scope: commit.scope, - notes, - references: commit.references, - mentions: [], - merge: null, - revert: null, - header: commit.message, - footer: commit.notes - .filter(note => note.title === 'RELEASE AS') - .map(note => `Release-As: ${note.text}`) - .join('\n'), - hash: commit.sha, - }; - }); + const changelogCommits = commits + // Filter out commits that are just release commits, they shouldn't be part of the changelog + .filter( + commit => !commit.bareMessage.toLowerCase().includes('chore: release ') + ) + .map(commit => { + const notes = commit.notes + .filter(note => note.title === 'BREAKING CHANGE') + .map(note => + replaceIssueLink( + note, + context.host, + context.owner, + context.repository + ) + ); + return { + body: '', // commit.body, + subject: htmlEscape(commit.bareMessage), + type: commit.type, + scope: commit.scope, + notes, + references: commit.references, + mentions: [], + merge: null, + revert: null, + header: commit.message, + footer: commit.notes + .filter(note => note.title === 'RELEASE AS') + .map(note => `Release-As: ${note.text}`) + .join('\n'), + hash: commit.sha, + }; + }); const result = conventionalChangelogWriter .parseArray(changelogCommits, context, preset.writerOpts)