diff --git a/dist/index.js b/dist/index.js index a6a608f..2695027 100644 --- a/dist/index.js +++ b/dist/index.js @@ -45752,7 +45752,10 @@ async function main() { // Comment on the PR with the summary, if requested. if (inputs.pr_comment) { const commentID = await findCommentOnPR(lib_github.context, github); - await commentOnPR(lib_github.context, github, commentID, `The latest Buf updates on your PR.\n\n${summary.stringify()}`); + await commentOnPR(lib_github.context, github, commentID, `The latest Buf updates on your PR. ${linkToRun("View")} the run, last updated ${new Date().toLocaleString("en-US", { + timeZone: "UTC", + hour12: true, + })}.\n\n${summary.stringify()}`); } // Write the summary to a file defined by GITHUB_STEP_SUMMARY. // NB: Write empties the buffer and must be after the comment. @@ -45772,24 +45775,13 @@ main() function createSummary(inputs, steps, moduleNames) { const table = [ [ - { data: "Build", header: true }, - { data: "Format", header: true }, - { data: "Lint", header: true }, - { data: "Breaking", header: true }, - { data: "Run", header: true }, - { data: "Updated (UTC)", header: true }, - ], - [ - message(steps.build), - message(steps.format), - message(steps.lint), - message(steps.breaking), - `view`, - new Date().toLocaleString("en-US", { - timeZone: "UTC", - hour12: true, - }), + { data: "Name", header: true }, + { data: "Status", header: true }, ], + ["build", message(steps.build)], + ["lint", message(steps.lint)], + ["format", message(steps.format)], + ["breaking", message(steps.breaking)], ]; // If push or archive is enabled add a link to the registry. let output = core.summary.addTable(table); @@ -46073,6 +46065,9 @@ function message(result) { return "🚫 cancelled"; } } +function linkToRun(message) { + return `${message}`; +} })(); diff --git a/src/main.ts b/src/main.ts index 1b224a0..97a5a1d 100644 --- a/src/main.ts +++ b/src/main.ts @@ -52,7 +52,13 @@ async function main() { context, github, commentID, - `The latest Buf updates on your PR.\n\n${summary.stringify()}`, + `The latest Buf updates on your PR. ${linkToRun("View")} the run, last updated ${new Date().toLocaleString( + "en-US", + { + timeZone: "UTC", + hour12: true, + }, + )}.\n\n${summary.stringify()}`, ); } // Write the summary to a file defined by GITHUB_STEP_SUMMARY. @@ -93,24 +99,13 @@ function createSummary( ): typeof core.summary { const table = [ [ - { data: "Build", header: true }, - { data: "Format", header: true }, - { data: "Lint", header: true }, - { data: "Breaking", header: true }, - { data: "Run", header: true }, - { data: "Updated (UTC)", header: true }, - ], - [ - message(steps.build), - message(steps.format), - message(steps.lint), - message(steps.breaking), - `view`, - new Date().toLocaleString("en-US", { - timeZone: "UTC", - hour12: true, - }), + { data: "Name", header: true }, + { data: "Status", header: true }, ], + ["build", message(steps.build)], + ["lint", message(steps.lint)], + ["format", message(steps.format)], + ["breaking", message(steps.breaking)], ]; // If push or archive is enabled add a link to the registry. let output = core.summary.addTable(table); @@ -444,3 +439,7 @@ function message(result: Result | undefined): string { return "🚫 cancelled"; } } + +function linkToRun(message: string): string { + return `${message}`; +}