mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
chore: give suggestion on PR open failure (#21145)
This commit is contained in:
parent
81fd514613
commit
8ecb649182
1 changed files with 20 additions and 12 deletions
|
@ -66,18 +66,26 @@ async function forwardReleaseCommitToMain() {
|
|||
await repo.gitPush("origin", newBranchName);
|
||||
|
||||
$.logStep(`Opening PR...`);
|
||||
const openedPr = await createOctoKit().request(
|
||||
"POST /repos/{owner}/{repo}/pulls",
|
||||
{
|
||||
...getGitHubRepository(),
|
||||
base: "main",
|
||||
head: newBranchName,
|
||||
draft: true,
|
||||
title: `chore: forward v${cliCrate.version} release commit to main`,
|
||||
body: getPrBody(),
|
||||
},
|
||||
);
|
||||
$.log(`Opened PR at ${openedPr.data.url}`);
|
||||
|
||||
try {
|
||||
const openedPr = await createOctoKit().request(
|
||||
"POST /repos/{owner}/{repo}/pulls",
|
||||
{
|
||||
...getGitHubRepository(),
|
||||
base: "main",
|
||||
head: newBranchName,
|
||||
draft: true,
|
||||
title: `chore: forward v${cliCrate.version} release commit to main`,
|
||||
body: getPrBody(),
|
||||
},
|
||||
);
|
||||
$.log(`Opened PR at ${openedPr.data.url}`);
|
||||
} catch (err) {
|
||||
$.logError(
|
||||
`Failed to open PR. Please open one manually: https://github.com/denoland/deno/pull/new/${newBranchName}`,
|
||||
err,
|
||||
);
|
||||
}
|
||||
|
||||
function getPrBody() {
|
||||
let text = "";
|
||||
|
|
Loading…
Reference in a new issue