Skip to content

Commit

Permalink
chore(release): improve merge commit back to main for patch releases (d…
Browse files Browse the repository at this point in the history
…enoland#18554)

This change commits with conflicts that can then be resolved manually.
  • Loading branch information
dsherret committed Apr 1, 2023
1 parent bac8e4f commit 30065af
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions tools/release/04_post_publish.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,18 @@ async function forwardReleaseCommitToMain() {
newBranchName,
"origin/main",
]);
await repo.command([
const cherryPickResult = await repo.command([
"git",
"cherry-pick",
"--strategy-option",
"theirs",
releaseCommitHash,
]);
]).noThrow();
if (cherryPickResult.code !== 0) {
// commit with conflicts that can be resolved in the PR
await repo.command("git add .");
await repo.command(
'git commit --no-verify -m "Cherry-pick version bump commit with conflicts"',
).noThrow();
}
await repo.gitPush("origin", newBranchName);

$.logStep(`Opening PR...`);
Expand All @@ -75,7 +80,13 @@ async function forwardReleaseCommitToMain() {
$.log(`Opened PR at ${openedPr.data.url}`);

function getPrBody() {
let text =
let text = "";

if (cherryPickResult.code !== 0) {
text += `**THIS PR HAS GIT CONFLICTS THAT MUST BE RESOLVED**\n\n`;
}

text +=
`This is the release commit being forwarded back to main for ${cliCrate.version}\n\n` +
`Please ensure:\n` +
`- [ ] Everything looks ok in the PR\n` +
Expand Down

0 comments on commit 30065af

Please sign in to comment.