diff --git a/dist/index.js b/dist/index.js index 3adccd5..01d7eaf 100644 --- a/dist/index.js +++ b/dist/index.js @@ -43285,27 +43285,27 @@ async function main({ return; } jobs.push(async () => { - core.startGroup(`PR #${stackNode.number}`); - const stackGraph2 = getStackGraph(stackNode, repoGraph); - const output = getOutput(stackGraph2, terminatingRefs); - core.info("--- Output ---"); - core.info(""); - output.split("\n").forEach(core.info); - core.info(""); - core.info("--- End output ---"); - core.info(""); - let description = stackNode.body ?? ""; - description = updateDescription({ - description, - output - }); - core.info("--- Updated description ---"); - core.info(""); - description.split("\n").forEach(core.info); - core.info(""); - core.info("--- End updated description ---"); - core.info(""); try { + core.startGroup(`PR #${stackNode.number}`); + const stackGraph2 = getStackGraph(stackNode, repoGraph); + const output = getOutput(stackGraph2, terminatingRefs); + core.info("--- Output ---"); + core.info(""); + output.split("\n").forEach(core.info); + core.info(""); + core.info("--- End output ---"); + core.info(""); + let description = stackNode.body ?? ""; + description = updateDescription({ + description, + output + }); + core.info("--- Updated description ---"); + core.info(""); + description.split("\n").forEach(core.info); + core.info(""); + core.info("--- End updated description ---"); + core.info(""); core.info("Updating PR via GitHub API..."); const response = await octokit.rest.pulls.update({ ...github.context.repo, @@ -43324,6 +43324,8 @@ async function main({ failedJobs.push(stackNode.number); if (error2 instanceof Error) { core.error(`Unable to update PR: ${error2.message}`); + } else { + core.error(String(error2)); } } finally { core.endGroup(); diff --git a/src/main.ts b/src/main.ts index c18626e..50f137c 100644 --- a/src/main.ts +++ b/src/main.ts @@ -101,32 +101,32 @@ export async function main({ } jobs.push(async () => { - core.startGroup(`PR #${stackNode.number}`) - - const stackGraph = getStackGraph(stackNode, repoGraph) - const output = getOutput(stackGraph, terminatingRefs) - - core.info('--- Output ---') - core.info('') - output.split('\n').forEach(core.info) - core.info('') - core.info('--- End output ---') - core.info('') - - let description = stackNode.body ?? '' - description = updateDescription({ - description, - output, - }) + try { + core.startGroup(`PR #${stackNode.number}`) - core.info('--- Updated description ---') - core.info('') - description.split('\n').forEach(core.info) - core.info('') - core.info('--- End updated description ---') - core.info('') + const stackGraph = getStackGraph(stackNode, repoGraph) + const output = getOutput(stackGraph, terminatingRefs) + + core.info('--- Output ---') + core.info('') + output.split('\n').forEach(core.info) + core.info('') + core.info('--- End output ---') + core.info('') + + let description = stackNode.body ?? '' + description = updateDescription({ + description, + output, + }) + + core.info('--- Updated description ---') + core.info('') + description.split('\n').forEach(core.info) + core.info('') + core.info('--- End updated description ---') + core.info('') - try { core.info('Updating PR via GitHub API...') const response = await octokit.rest.pulls.update({ ...github.context.repo, @@ -147,6 +147,8 @@ export async function main({ if (error instanceof Error) { core.error(`Unable to update PR: ${error.message}`) + } else { + core.error(String(error)) } } finally { core.endGroup()