diff --git a/.changeset/light-readers-rest.md b/.changeset/light-readers-rest.md new file mode 100644 index 000000000..c8e139644 --- /dev/null +++ b/.changeset/light-readers-rest.md @@ -0,0 +1,5 @@ +--- +"@osdk/tool.release": minor +--- + +Properly generate titles and body copy after exiting pre mode diff --git a/.changeset/pre.json b/.changeset/pre.json index 43369b842..10f842851 100644 --- a/.changeset/pre.json +++ b/.changeset/pre.json @@ -1,5 +1,5 @@ { - "mode": "pre", + "mode": "exit", "tag": "beta", "initialVersions": { "@osdk/examples.docs.example": "0.0.1", diff --git a/packages/tool.release/src/runVersion.ts b/packages/tool.release/src/runVersion.ts index 6ea6ce75c..c22e3b298 100644 --- a/packages/tool.release/src/runVersion.ts +++ b/packages/tool.release/src/runVersion.ts @@ -194,9 +194,13 @@ export async function runVersion({ } else { // project with `commit: true` setting could have already committed files if (!(await gitUtils.checkIfClean())) { - const finalCommitMessage = `${commitMessage}${ - !!preState ? ` (${preState.tag})` : "" - }`; + let finalCommitMessage = commitMessage; + if (preState && preState.mode === "pre") { + finalCommitMessage += ` (${preState.tag})`; + } else if (preState && preState.mode === "exit") { + finalCommitMessage += ` (exit ${preState.tag})`; + } + await gitUtils.commitAll(finalCommitMessage); } diff --git a/packages/tool.release/src/util/getVersionPrBody.ts b/packages/tool.release/src/util/getVersionPrBody.ts index 822d33ae0..6ae54d261 100644 --- a/packages/tool.release/src/util/getVersionPrBody.ts +++ b/packages/tool.release/src/util/getVersionPrBody.ts @@ -72,7 +72,7 @@ export async function getVersionPrBody({ `This PR was opened by automation. When you're ready to do a release, you can merge this and publish to npm yourself. If you're not ready to do a release yet, that's fine, whenever you re-run the release script in ${branch}, this PR will be updated. `; - const messagePreState = !!preState + const messagePreState = preState && preState.mode === "pre" ? `⚠️⚠️⚠️⚠️⚠️⚠️ \`${branch}\` is currently in **pre mode** so this branch has prereleases rather than normal releases. If you want to exit prereleases, run \`changeset pre exit\` on \`${branch}\`.