@@ -126,7 +126,7 @@ async function fetchGitHubCommitDetails(
126126
127127 const githubUsername = commit . author ?. login || commit . committer ?. login || 'unknown'
128128
129- let cleanMessage = commit . commit . message . split ( '\n' ) [ 0 ] // First line only
129+ let cleanMessage = commit . commit . message . split ( '\n' ) [ 0 ]
130130 if ( prNumber ) {
131131 cleanMessage = cleanMessage . replace ( / \s * \( # \d + \) \s * $ / , '' )
132132 }
@@ -226,12 +226,23 @@ async function getCommitsBetweenVersions(
226226function categorizeCommit ( message : string ) : 'features' | 'fixes' | 'improvements' | 'other' {
227227 const msgLower = message . toLowerCase ( )
228228
229- if (
230- msgLower . includes ( 'feat' ) ||
231- msgLower . includes ( 'add' ) ||
232- msgLower . includes ( 'implement' ) ||
233- msgLower . includes ( 'new ' )
234- ) {
229+ if ( / ^ f e a t ( \( | : | ! ) / . test ( msgLower ) ) {
230+ return 'features'
231+ }
232+
233+ if ( / ^ f i x ( \( | : | ! ) / . test ( msgLower ) ) {
234+ return 'fixes'
235+ }
236+
237+ if ( / ^ ( i m p r o v e m e n t | i m p r o v e | p e r f | r e f a c t o r ) ( \( | : | ! ) / . test ( msgLower ) ) {
238+ return 'improvements'
239+ }
240+
241+ if ( / ^ ( c h o r e | d o c s | s t y l e | t e s t | c i | b u i l d ) ( \( | : | ! ) / . test ( msgLower ) ) {
242+ return 'other'
243+ }
244+
245+ if ( msgLower . includes ( 'feat' ) || msgLower . includes ( 'implement' ) || msgLower . includes ( 'new ' ) ) {
235246 return 'features'
236247 }
237248
@@ -242,9 +253,10 @@ function categorizeCommit(message: string): 'features' | 'fixes' | 'improvements
242253 if (
243254 msgLower . includes ( 'improve' ) ||
244255 msgLower . includes ( 'enhance' ) ||
245- msgLower . includes ( 'update' ) ||
246256 msgLower . includes ( 'upgrade' ) ||
247- msgLower . includes ( 'optimization' )
257+ msgLower . includes ( 'optimization' ) ||
258+ msgLower . includes ( 'add' ) ||
259+ msgLower . includes ( 'update' )
248260 ) {
249261 return 'improvements'
250262 }
0 commit comments