Skip to content

Commit 7909818

Browse files
Brian Vaughnrickhanlonii
authored andcommitted
DevTools release script: Show changelog before minor/patch prompt (#24200)
1 parent 9d3b3d5 commit 7909818

File tree

1 file changed

+18
-8
lines changed

1 file changed

+18
-8
lines changed

scripts/devtools/prepare-release.js

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,16 @@ async function main() {
3131

3232
await checkNPMPermissions();
3333

34+
const sha = await getPreviousCommitSha();
35+
const [shortCommitLog, formattedCommitLog] = await getCommitLog(sha);
36+
37+
console.log('');
38+
console.log(
39+
'This release includes the following commits:',
40+
chalk.gray(shortCommitLog)
41+
);
42+
console.log('');
43+
3444
const releaseType = await getReleaseType();
3545

3646
const path = join(ROOT_PATH, PACKAGE_PATHS[0]);
@@ -41,6 +51,10 @@ async function main() {
4151
? `${major}.${minor + 1}.0`
4252
: `${major}.${minor}.${patch + 1}`;
4353

54+
updateChangelog(nextVersion, formattedCommitLog);
55+
56+
await reviewChangelogPrompt();
57+
4458
updatePackageVersions(previousVersion, nextVersion);
4559
updateManifestVersions(previousVersion, nextVersion);
4660

@@ -52,13 +66,6 @@ async function main() {
5266
);
5367
console.log('');
5468

55-
const sha = await getPreviousCommitSha();
56-
const commitLog = await getCommitLog(sha);
57-
58-
updateChangelog(nextVersion, commitLog);
59-
60-
await reviewChangelogPrompt();
61-
6269
await commitPendingChanges(previousVersion, nextVersion);
6370

6471
printFinalInstructions();
@@ -89,6 +96,7 @@ async function commitPendingChanges(previousVersion, nextVersion) {
8996
}
9097

9198
async function getCommitLog(sha) {
99+
let shortLog = '';
92100
let formattedLog = '';
93101

94102
const rawLog = await execRead(`
@@ -103,12 +111,14 @@ async function getCommitLog(sha) {
103111
const pr = match[2];
104112

105113
formattedLog += `\n* ${title} ([USERNAME](https://github.com/USERNAME) in [#${pr}](${PULL_REQUEST_BASE_URL}${pr}))`;
114+
shortLog += `\n* ${title}`;
106115
} else {
107116
formattedLog += `\n* ${line}`;
117+
shortLog += `\n* ${line}`;
108118
}
109119
});
110120

111-
return formattedLog;
121+
return [shortLog, formattedLog];
112122
}
113123

114124
async function getPreviousCommitSha() {

0 commit comments

Comments
 (0)