1- import { green , grey } from 'chalk' ;
1+ import { bold , green , yellow } from 'chalk' ;
22import { createReadStream , createWriteStream , readFileSync } from 'fs' ;
33import { prompt } from 'inquirer' ;
44import { join } from 'path' ;
@@ -63,7 +63,8 @@ export async function promptChangelogReleaseName(): Promise<string> {
6363 * and has been cherry-picked into "master". In that case, the changelog will already contain
6464 * commits from master which might be added to the changelog again. This is because usually
6565 * patch and minor releases are tagged from the publish branches and therefore
66- * conventional-changelog tries to build the changelog from last major version to master's HEAD.
66+ * conventional-changelog tries to build the changelog from last major version to master's
67+ * HEAD when a new major version is being published from the "master" branch.
6768 */
6869function createDedupeWriterOptions ( changelogPath : string ) {
6970 const existingChangelogContent = readFileSync ( changelogPath , 'utf8' ) ;
@@ -76,8 +77,8 @@ function createDedupeWriterOptions(changelogPath: string) {
7677 group . commits = group . commits . filter ( ( commit : any ) => {
7778 // NOTE: We cannot compare the SHA's because the commits will have a different SHA
7879 // if they are being cherry-picked into a different branch.
79- if ( existingChangelogContent . includes ( commit . header ) ) {
80- console . log ( grey ( `Excluding : "${ commit . header } " ( ${ commit . hash } ) `) ) ;
80+ if ( existingChangelogContent . includes ( commit . subject ) ) {
81+ console . log ( yellow ( ` ↺ Skipping duplicate : "${ bold ( commit . header ) } " `) ) ;
8182 return false ;
8283 }
8384 return true ;
0 commit comments