File tree Expand file tree Collapse file tree 1 file changed +21
-4
lines changed
Expand file tree Collapse file tree 1 file changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -450,10 +450,27 @@ const generateChangelog = async (
450450
451451 if ( isBreaking ) hasBreakingChanges = true
452452
453- const affectedPackages =
454- message . match ( / ^ \w + \( ( .* ?) \) ! ? : / ) ?. slice ( 1 , 2 ) ||
455- message . match ( / ^ @ a f f e c t s ( .* ) ? / m) ?. [ 1 ] . split ( ', ' ) ||
456- [ ]
453+ const packageSet = new Set < string > ( )
454+
455+ const scopeMatch = message . match ( / ^ \w + \( ( .* ?) \) ! ? : / )
456+
457+ if ( scopeMatch ) {
458+ for ( const pkg of scopeMatch [ 1 ] . split ( ',' ) ) {
459+ const trimmed = pkg . trim ( )
460+ if ( trimmed ) packageSet . add ( trimmed )
461+ }
462+ }
463+
464+ const affectsMatch = message . match ( / ^ @ a f f e c t s ( .+ ) / m)
465+
466+ if ( affectsMatch ) {
467+ for ( const pkg of affectsMatch [ 1 ] . split ( ',' ) ) {
468+ const trimmed = pkg . trim ( )
469+ if ( trimmed ) packageSet . add ( trimmed )
470+ }
471+ }
472+
473+ const affectedPackages = [ ...packageSet ]
457474
458475 const item : CommitItem = {
459476 affectedPackages,
You can’t perform that action at this time.
0 commit comments