@@ -3,7 +3,7 @@ import { readFile, writeFile } from 'fs/promises';
33import dayjs from 'dayjs' ;
44import { convert } from 'convert-gitmoji' ;
55import { partition , groupBy , capitalize , join } from './shared' ;
6- import { VERSION_REG , VERSION_REG_OF_MARKDOWN } from './constant' ;
6+ import { VERSION_REG , VERSION_WITH_RELEASE , VERSION_REG_OF_MARKDOWN } from './constant' ;
77import type { Reference , GitCommit , ChangelogOption , ResolvedAuthor } from './types' ;
88
99function formatReferences ( references : Reference [ ] , githubRepo : string , type : 'issues' | 'hash' ) : string {
@@ -108,7 +108,7 @@ function getGitUserAvatar(userName: string) {
108108
109109function createContributorLine ( contributors : ResolvedAuthor [ ] ) {
110110 let loginLine = '' ;
111- let unloginLine = '' ;
111+ let unLoginLine = '' ;
112112
113113 contributors . forEach ( ( contributor , index ) => {
114114 const { name, email, login } = contributor ;
@@ -120,15 +120,15 @@ function createContributorLine(contributors: ResolvedAuthor[]) {
120120 line += ', ' ;
121121 }
122122
123- unloginLine += line ;
123+ unLoginLine += line ;
124124 } else {
125125 const githubUrl = getUserGithub ( login ) ;
126126 const avatar = getGitUserAvatar ( login ) ;
127127 loginLine += `[](${ githubUrl } ) ` ;
128128 }
129129 } ) ;
130130
131- return `${ loginLine } \n${ unloginLine } ` ;
131+ return `${ loginLine } \n${ unLoginLine } ` ;
132132}
133133
134134export function generateMarkdown ( params : {
@@ -137,7 +137,10 @@ export function generateMarkdown(params: {
137137 showTitle : boolean ;
138138 contributors : ResolvedAuthor [ ] ;
139139} ) {
140- const { commits, options, showTitle, contributors } = params ;
140+ const { options, showTitle, contributors } = params ;
141+
142+ // filter commits means that release version
143+ const commits = params . commits . filter ( commit => commit . description . match ( VERSION_WITH_RELEASE ) === null ) ;
141144
142145 const lines : string [ ] = [ ] ;
143146
@@ -163,7 +166,7 @@ export function generateMarkdown(params: {
163166
164167 const group = groupBy ( changes , 'type' ) ;
165168
166- lines . push ( ...formatSection ( breaking , options . titles . breakingChanges ! , options ) ) ;
169+ lines . push ( ...formatSection ( breaking , options . titles . breakingChanges , options ) ) ;
167170
168171 for ( const type of Object . keys ( options . types ) ) {
169172 const items = group [ type ] || [ ] ;
0 commit comments