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 {
55
55
// For now, close the ones with Security Release label
56
56
await this . closePRWithLabel ( 'Security Release' ) ;
57
57
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
+
58
74
const updateFolder = await this . cli . prompt (
59
75
`Would you like to update the next-security-release folder to ${
60
76
vulnerabilityJSON . releaseDate } ?`,
Original file line number Diff line number Diff line change @@ -81,6 +81,23 @@ export default class Request {
81
81
return this . json ( url , options ) ;
82
82
}
83
83
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
+
84
101
async getPullRequest ( fullUrl ) {
85
102
const prUrl = fullUrl . replace ( 'https://github.com/' , 'https://api.github.com/repos/' ) . replace ( 'pull' , 'pulls' ) ;
86
103
const options = {
You can’t perform that action at this time.
0 commit comments