@@ -16,7 +16,8 @@ export interface updatedDependency extends dependencyAlert {
16
16
prevVersion : string ,
17
17
newVersion : string ,
18
18
compatScore : number ,
19
- maintainerChanges : boolean
19
+ maintainerChanges : boolean ,
20
+ dependencyGroup : string
20
21
}
21
22
22
23
export interface alertLookup {
@@ -31,6 +32,7 @@ export async function parse (commitMessage: string, body: string, branchName: st
31
32
const bumpFragment = commitMessage . match ( / ^ B u m p s .* f r o m (?< from > v ? \d [ ^ ] * ) t o (?< to > v ? \d [ ^ ] * ) \. $ / m)
32
33
const updateFragment = commitMessage . match ( / ^ U p d a t e .* r e q u i r e m e n t f r o m \S * ? ? (?< from > v ? \d \S * ) t o \S * ? ? (?< to > v ? \d \S * ) $ / m)
33
34
const yamlFragment = commitMessage . match ( / ^ - { 3 } \n (?< dependencies > [ \S | \s ] * ?) \n ^ \. { 3 } \n / m)
35
+ const groupName = body . match ( / ^ B u m p s t h e (?< name > \S * ) g r o u p w i t h / m)
34
36
const newMaintainer = ! ! body . match ( / M a i n t a i n e r c h a n g e s / m)
35
37
const lookupFn = lookup ?? ( ( ) => Promise . resolve ( { alertState : '' , ghsaId : '' , cvss : 0 } ) )
36
38
const scoreFn = getScore ?? ( ( ) => Promise . resolve ( 0 ) )
@@ -43,6 +45,7 @@ export async function parse (commitMessage: string, body: string, branchName: st
43
45
const chunks = branchName . split ( delim )
44
46
const prev = bumpFragment ?. groups ?. from ?? ( updateFragment ?. groups ?. from ?? '' )
45
47
const next = bumpFragment ?. groups ?. to ?? ( updateFragment ?. groups ?. to ?? '' )
48
+ const dependencyGroup = groupName ?. groups ?. name ?? ''
46
49
47
50
if ( data [ 'updated-dependencies' ] ) {
48
51
return await Promise . all ( data [ 'updated-dependencies' ] . map ( async ( dependency , index ) => {
@@ -61,6 +64,7 @@ export async function parse (commitMessage: string, body: string, branchName: st
61
64
newVersion : nextVersion ,
62
65
compatScore : await scoreFn ( dependency [ 'dependency-name' ] , lastVersion , nextVersion , chunks [ 1 ] ) ,
63
66
maintainerChanges : newMaintainer ,
67
+ dependencyGroup : dependencyGroup ,
64
68
...await lookupFn ( dependency [ 'dependency-name' ] , lastVersion , dirname )
65
69
}
66
70
} ) )
0 commit comments