Skip to content

Commit

Permalink
feat(git-node): add --releaseDate to git node release (#863)
Browse files Browse the repository at this point in the history
This will enable us to automate release proposal
creation: nodejs/security-wg#860
  • Loading branch information
RafaelGSS authored Nov 2, 2024
1 parent 9a40d21 commit 48cbfd6
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 4 additions & 0 deletions components/git/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ const releaseOptions = {
startLTS: {
describe: 'Mark the release as the transition from Current to LTS',
type: 'boolean'
},
releaseDate: {
describe: 'Default relase date when --prepare is used. It must be YYYY-MM-DD',
type: 'string'
}
};

Expand Down
6 changes: 4 additions & 2 deletions docs/git-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ Options:
--security Demarcate the new security release as a security release [boolean]
--startLTS Mark the release as the transition from Current to LTS [boolean]
--filterLabel Filter PR by label when preparing a security release [string]
--releaseDate Default relase date when --prepare is used.
It must be YYYY-MM-DD [string]
```

### Example
Expand Down Expand Up @@ -462,7 +464,7 @@ It will retrieve all the triaged HackerOne reports and add creates the `vulnerab

This command updates the `vulnerabilities.json` with target date of the security release.
Example:

```sh
git node security --update-date=2023/12/31
```
Expand All @@ -471,7 +473,7 @@ Example:

This command creates a pre-release announcement for the security release.
Example:

```sh
git node security --pre-release
```
Expand Down
4 changes: 2 additions & 2 deletions lib/prepare_release.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export default class ReleasePreparation extends Session {
this.isLTS = false;
this.isLTSTransition = argv.startLTS;
this.runBranchDiff = !argv.skipBranchDiff;
this.defaultReleaseDate = argv.releaseDate ?? new Date().toISOString().slice(0, 10);
this.ltsCodename = '';
this.date = '';
this.filterLabels = argv.filterLabel && argv.filterLabel.split(',');
Expand Down Expand Up @@ -241,9 +242,8 @@ export default class ReleasePreparation extends Session {
cli.stopSpinner('Updated REPLACEME items in docs');

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

cli.startSpinner('Updating CHANGELOG.md');
await this.updateMainChangelog();
Expand Down

0 comments on commit 48cbfd6

Please sign in to comment.