File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,19 @@ export default class PrepareSecurityRelease extends SecurityRelease {
54
54
this . cli . info ( 'Closing pull requests' ) ;
55
55
// For now, close the ones with vN.x label
56
56
await this . closePRWithLabel ( this . getAffectedVersions ( vulnerabilityJSON ) ) ;
57
+
58
+ const updateFolder = this . cli . prompt (
59
+ // eslint-disable-next-line max-len
60
+ `Would you like to update the next-security-release folder to ${ vulnerabilityJSON . releaseDate } ?` ,
61
+ { defaultAnswer : true } ) ;
62
+ if ( updateFolder ) {
63
+ const newFolder = this . updateReleaseFolder ( vulnerabilityJSON . releaseDate ) ;
64
+ commitAndPushVulnerabilitiesJSON (
65
+ newFolder ,
66
+ 'chore: change next-security-release folder' ,
67
+ { cli : this . cli , repository : this . repository }
68
+ ) ;
69
+ }
57
70
this . cli . info ( `Merge pull request with:
58
71
- git checkout main
59
72
- git merge --squash ${ NEXT_SECURITY_RELEASE_BRANCH }
Original file line number Diff line number Diff line change @@ -233,6 +233,14 @@ export class SecurityRelease {
233
233
NEXT_SECURITY_RELEASE_FOLDER , 'vulnerabilities.json' ) ;
234
234
}
235
235
236
+ updateReleaseFolder ( releaseDate ) {
237
+ const folder = path . join ( process . cwd ( ) ,
238
+ NEXT_SECURITY_RELEASE_FOLDER ) ;
239
+ const newFolder = path . join ( process . cwd ( ) , releaseDate ) ;
240
+ fs . renameSync ( folder , newFolder ) ;
241
+ return newFolder ;
242
+ }
243
+
236
244
updateVulnerabilitiesJSON ( content ) {
237
245
try {
238
246
const vulnerabilitiesJSONPath = this . getVulnerabilitiesJSONPath ( ) ;
You can’t perform that action at this time.
0 commit comments