@@ -52,24 +52,27 @@ export default class PrepareSecurityRelease extends SecurityRelease {
52
52
await this . closeAndRequestDisclosure ( vulnerabilityJSON . reports ) ;
53
53
54
54
this . cli . info ( 'Closing pull requests' ) ;
55
- // For now, close the ones with vN.x label
56
- await this . closePRWithLabel ( this . getAffectedVersions ( vulnerabilityJSON ) ) ;
55
+ // For now, close the ones with Security Release label
56
+ await this . closePRWithLabel ( 'Security Release' ) ;
57
57
58
- const updateFolder = this . cli . prompt (
58
+ const updateFolder = await this . cli . prompt (
59
59
// eslint-disable-next-line max-len
60
60
`Would you like to update the next-security-release folder to ${ vulnerabilityJSON . releaseDate } ?` ,
61
61
{ defaultAnswer : true } ) ;
62
62
if ( updateFolder ) {
63
- const newFolder = this . updateReleaseFolder ( vulnerabilityJSON . releaseDate ) ;
63
+ this . updateReleaseFolder (
64
+ vulnerabilityJSON . releaseDate . replaceAll ( '/' , '-' )
65
+ ) ;
66
+ const securityReleaseFolder = path . join ( process . cwd ( ) , 'security-release' ) ;
64
67
commitAndPushVulnerabilitiesJSON (
65
- newFolder ,
68
+ securityReleaseFolder ,
66
69
'chore: change next-security-release folder' ,
67
70
{ cli : this . cli , repository : this . repository }
68
71
) ;
69
72
}
70
73
this . cli . info ( `Merge pull request with:
71
74
- git checkout main
72
- - git merge --squash ${ NEXT_SECURITY_RELEASE_BRANCH }
75
+ - git merge ${ NEXT_SECURITY_RELEASE_BRANCH } --no-ff -m "chore: add latest security release"
73
76
- git push origin main` ) ;
74
77
this . cli . ok ( 'Done!' ) ;
75
78
}
@@ -306,16 +309,17 @@ export default class PrepareSecurityRelease extends SecurityRelease {
306
309
labels = [ labels ] ;
307
310
}
308
311
309
- const url = 'https://github.com/nodejs-private/node-private/pulls ' ;
312
+ const url = 'https://github.com/nodejs-private/node-private/pull ' ;
310
313
this . cli . startSpinner ( 'Closing GitHub Pull Requests...' ) ;
311
314
// At this point, GitHub does not provide filters through their REST API
312
- const prs = this . req . getPullRequest ( url ) ;
315
+ const prs = await this . req . getPullRequest ( url ) ;
313
316
for ( const pr of prs ) {
314
- if ( pr . labels . some ( ( l ) => labels . includes ( l ) ) ) {
315
- this . cli . updateSpinner ( `Closing Pull Request: ${ pr . id } ` ) ;
316
- await this . req . closePullRequest ( pr . id ) ;
317
+ if ( pr . labels . some ( ( l ) => labels . includes ( l . name ) ) ) {
318
+ this . cli . updateSpinner ( `Closing Pull Request: ${ pr . number } ` ) ;
319
+ await this . req . closePullRequest ( pr . number ,
320
+ { owner : 'nodejs-private' , repo : 'node-private' } ) ;
317
321
}
318
322
}
319
- this . cli . startSpinner ( 'Closed GitHub Pull Requests.' ) ;
323
+ this . cli . stopSpinner ( 'Closed GitHub Pull Requests.' ) ;
320
324
}
321
325
}
0 commit comments