From 5fc4627fdc38108b61136148ac54ba5c620dcb51 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Wed, 9 Feb 2022 00:33:57 +0100 Subject: [PATCH] Enhance outputs display Signed-off-by: CrazyMax --- dist/index.js | 24 ++++++++++++------------ src/main.ts | 25 +++++++++++++------------ 2 files changed, 25 insertions(+), 24 deletions(-) diff --git a/dist/index.js b/dist/index.js index dd591ff1b..40194ef3b 100644 --- a/dist/index.js +++ b/dist/index.js @@ -516,18 +516,18 @@ function run() { throw new Error(`buildx failed with: ${res.stderr.match(/(.*)\s*$/)[0].trim()}`); } }); - yield core.group(`Setting outputs`, () => __awaiter(this, void 0, void 0, function* () { - const imageID = yield buildx.getImageID(); - const metadata = yield buildx.getMetadata(); - if (imageID) { - core.info(`digest=${imageID}`); - context.setOutput('digest', imageID); - } - if (metadata) { - core.info(`metadata=${metadata}`); - context.setOutput('metadata', metadata); - } - })); + const imageID = yield buildx.getImageID(); + if (imageID) { + yield core.group(`Digest output`, () => __awaiter(this, void 0, void 0, function* () { + core.info(imageID); + })); + } + const metadata = yield buildx.getMetadata(); + if (metadata) { + yield core.group(`Metadata output`, () => __awaiter(this, void 0, void 0, function* () { + core.info(metadata); + })); + } } catch (error) { core.setFailed(error.message); diff --git a/src/main.ts b/src/main.ts index d1ce06d07..80b8bf5d3 100644 --- a/src/main.ts +++ b/src/main.ts @@ -33,18 +33,19 @@ async function run(): Promise { } }); - await core.group(`Setting outputs`, async () => { - const imageID = await buildx.getImageID(); - const metadata = await buildx.getMetadata(); - if (imageID) { - core.info(`digest=${imageID}`); - context.setOutput('digest', imageID); - } - if (metadata) { - core.info(`metadata=${metadata}`); - context.setOutput('metadata', metadata); - } - }); + const imageID = await buildx.getImageID(); + if (imageID) { + await core.group(`Digest output`, async () => { + core.info(imageID); + }); + } + + const metadata = await buildx.getMetadata(); + if (metadata) { + await core.group(`Metadata output`, async () => { + core.info(metadata); + }); + } } catch (error) { core.setFailed(error.message); }