1
0
Fork 0
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:
Divy Srivastava 2023-11-10 05:40:00 -08:00 committed by GitHub
parent 81fd514613
commit 8ecb649182
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 = "";