Skip to content

Commit e665835

Browse files
committed
feat: add --releaseDate to git node release
This will enable us to automate release proposal creation: nodejs/security-wg#860
1 parent 9224469 commit e665835

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

components/git/release.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ const releaseOptions = {
3232
startLTS: {
3333
describe: 'Mark the release as the transition from Current to LTS',
3434
type: 'boolean'
35+
},
36+
releaseDate: {
37+
describe: 'Default relase date when --prepare is used. It must be YYYY-MM-DD',
38+
type: 'string'
3539
}
3640
};
3741

docs/git-node.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,8 @@ Options:
224224
--security Demarcate the new security release as a security release [boolean]
225225
--startLTS Mark the release as the transition from Current to LTS [boolean]
226226
--filterLabel Filter PR by label when preparing a security release [string]
227+
--releaseDate Default relase date when --prepare is used.
228+
It must be YYYY-MM-DD [string]
227229
```
228230

229231
### Example
@@ -336,7 +338,7 @@ ncu-config set waitTimeMultiApproval 48
336338

337339
## `git node v8`
338340

339-
Update or patch the V8 engine.
341+
Update or patch the V8 engine.
340342
This tool will maintain a clone of the V8 repository in `~/.update-v8/v8`
341343
if it's used without `--v8-dir`.
342344

@@ -373,7 +375,7 @@ Options:
373375
### `git node v8 minor`
374376

375377
Compare current V8 version with latest upstream of the same major. Applies a
376-
patch if necessary.
378+
patch if necessary.
377379
If the `git apply` command fails, a patch file will be written in the Node.js
378380
clone directory.
379381

@@ -462,7 +464,7 @@ It will retrieve all the triaged HackerOne reports and add creates the `vulnerab
462464

463465
This command updates the `vulnerabilities.json` with target date of the security release.
464466
Example:
465-
467+
466468
```sh
467469
git node security --update-date=2023/12/31
468470
```
@@ -471,7 +473,7 @@ Example:
471473

472474
This command creates a pre-release announcement for the security release.
473475
Example:
474-
476+
475477
```sh
476478
git node security --pre-release
477479
```

lib/prepare_release.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export default class ReleasePreparation extends Session {
2525
this.isLTS = false;
2626
this.isLTSTransition = argv.startLTS;
2727
this.runBranchDiff = !argv.skipBranchDiff;
28+
this.defaultReleaseDate = argv.releaseDate ?? new Date().toISOString().split('T')[0];
2829
this.ltsCodename = '';
2930
this.date = '';
3031
this.filterLabels = argv.filterLabel && argv.filterLabel.split(',');
@@ -241,9 +242,8 @@ export default class ReleasePreparation extends Session {
241242
cli.stopSpinner('Updated REPLACEME items in docs');
242243

243244
// Fetch date to use in release commit & changelogs.
244-
const todayDate = new Date().toISOString().split('T')[0];
245245
this.date = await cli.prompt('Enter release date in YYYY-MM-DD format:',
246-
{ questionType: 'input', defaultAnswer: todayDate });
246+
{ questionType: 'input', defaultAnswer: this.defaultReleaseDate });
247247

248248
cli.startSpinner('Updating CHANGELOG.md');
249249
await this.updateMainChangelog();

0 commit comments

Comments
 (0)