File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,22 @@ export default class PrepareSecurityRelease extends SecurityRelease {
5555 // For now, close the ones with Security Release label
5656 await this . closePRWithLabel ( 'Security Release' ) ;
5757
58+ if ( vulnerabilityJSON . buildIssue ) {
59+ this . cli . info ( 'Commenting on nodejs/build issue' ) ;
60+ await this . req . commentIssue (
61+ vulnerabilityJSON . buildIssue ,
62+ 'Security release is out'
63+ ) ;
64+ }
65+
66+ if ( vulnerabilityJSON . dockerIssue ) {
67+ this . cli . info ( 'Commenting on nodejs/docker-node issue' ) ;
68+ await this . req . commentIssue (
69+ vulnerabilityJSON . dockerIssue ,
70+ 'Security release is out'
71+ ) ;
72+ }
73+
5874 const updateFolder = await this . cli . prompt (
5975 `Would you like to update the next-security-release folder to ${
6076 vulnerabilityJSON . releaseDate } ?`,
Original file line number Diff line number Diff line change @@ -81,6 +81,23 @@ export default class Request {
8181 return this . json ( url , options ) ;
8282 }
8383
84+ async commentIssue ( fullUrl , comment ) {
85+ const commentUrl = fullUrl . replace ( 'https://github.com/' , 'https://api.github.com/repos/' ) +
86+ '/comments' ;
87+ const options = {
88+ method : 'POST' ,
89+ headers : {
90+ Authorization : `Basic ${ this . credentials . github } ` ,
91+ 'User-Agent' : 'node-core-utils' ,
92+ Accept : 'application/vnd.github+json'
93+ } ,
94+ body : JSON . stringify ( {
95+ body : comment ,
96+ } )
97+ } ;
98+ return this . json ( commentUrl , options ) ;
99+ }
100+
84101 async getPullRequest ( fullUrl ) {
85102 const prUrl = fullUrl . replace ( 'https://github.com/' , 'https://api.github.com/repos/' ) . replace ( 'pull' , 'pulls' ) ;
86103 const options = {
You can’t perform that action at this time.
0 commit comments