@@ -56,11 +56,16 @@ export default class PrepareSecurityRelease extends SecurityRelease {
5656
5757 this . req = new Request ( credentials ) ;
5858 const vulnerabilityJSON = this . readVulnerabilitiesJSON ( ) ;
59+ this . cli . info ( 'Closing and request disclosure to HackerOne reports' ) ;
5960 await this . closeAndRequestDisclosure ( vulnerabilityJSON . reports ) ;
61+
62+ this . cli . info ( 'Closing pull requests' ) ;
6063 // For now, close the ones with vN.x label
6164 await this . closePRWithLabel ( this . getAffectedVersions ( vulnerabilityJSON ) ) ;
62- // TODO: Update next-security-release folder to current releaseDate
63- // TODO: Merge the PR
65+ this . cli . info ( `Merge pull request with:
66+ - git checkout main
67+ - git merge --squash ${ NEXT_SECURITY_RELEASE_BRANCH }
68+ - git push origin main` ) ;
6469 this . cli . ok ( 'Done!' ) ;
6570 }
6671
@@ -278,30 +283,36 @@ export default class PrepareSecurityRelease extends SecurityRelease {
278283 }
279284
280285 async closeAndRequestDisclosure ( jsonReports ) {
286+ this . cli . startSpinner ( 'Closing HackerOne reports' ) ;
281287 for ( const report of jsonReports ) {
288+ this . cli . updateSpinner ( `Closing report ${ report . id } ...` ) ;
282289 await this . req . updateReportState (
283290 report . id ,
284291 'resolved' ,
285292 'Closing as resolved'
286293 ) ;
287- // TODO: Request Disclosure
294+
295+ this . cli . updateSpinner ( `Requesting disclosure to report ${ report . id } ...` ) ;
296+ await this . req . requestDisclosure ( report . id ) ;
288297 }
298+ this . cli . stopSpinner ( 'Done closing H1 Reports and requesting disclosure' ) ;
289299 }
290300
291301 async closePRWithLabel ( labels ) {
292302 if ( typeof labels === 'string' ) {
293303 labels = [ labels ] ;
294304 }
295305
296- const url = 'https://github.com/nodejs-private/node-private/pulls'
306+ const url = 'https://github.com/nodejs-private/node-private/pulls' ;
307+ this . cli . startSpinner ( 'Closing GitHub Pull Requests...' ) ;
297308 // At this point, GitHub does not provide filters through their REST API
298309 const prs = this . req . getPullRequest ( url ) ;
299310 for ( const pr of prs ) {
300311 if ( pr . labels . some ( ( l ) => labels . includes ( l ) ) ) {
301- this . cli . info ( `Closing Pull Request: ${ pr . id } ` ) ;
302- // TODO assert
312+ this . cli . updateSpinner ( `Closing Pull Request: ${ pr . id } ` ) ;
303313 await this . req . closePullRequest ( pr . id ) ;
304314 }
305315 }
316+ this . cli . startSpinner ( 'Closed GitHub Pull Requests.' ) ;
306317 }
307318}
0 commit comments