1
- import { green , grey } from 'chalk' ;
1
+ import { bold , green , yellow } from 'chalk' ;
2
2
import { createReadStream , createWriteStream , readFileSync } from 'fs' ;
3
3
import { prompt } from 'inquirer' ;
4
4
import { join } from 'path' ;
@@ -63,7 +63,8 @@ export async function promptChangelogReleaseName(): Promise<string> {
63
63
* and has been cherry-picked into "master". In that case, the changelog will already contain
64
64
* commits from master which might be added to the changelog again. This is because usually
65
65
* 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.
67
68
*/
68
69
function createDedupeWriterOptions ( changelogPath : string ) {
69
70
const existingChangelogContent = readFileSync ( changelogPath , 'utf8' ) ;
@@ -76,8 +77,8 @@ function createDedupeWriterOptions(changelogPath: string) {
76
77
group . commits = group . commits . filter ( ( commit : any ) => {
77
78
// NOTE: We cannot compare the SHA's because the commits will have a different SHA
78
79
// 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 ) } " `) ) ;
81
82
return false ;
82
83
}
83
84
return true ;
0 commit comments