From 5af8693d821f846a78ae05d8b9222e0162b4f1d5 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Wed, 9 Feb 2022 11:32:35 +0100 Subject: [PATCH] Enhance outputs display Signed-off-by: CrazyMax --- dist/index.js | 22 ++++++++++++---------- src/main.ts | 23 +++++++++++++---------- 2 files changed, 25 insertions(+), 20 deletions(-) diff --git a/dist/index.js b/dist/index.js index dd591ff1b..9340fde65 100644 --- a/dist/index.js +++ b/dist/index.js @@ -516,18 +516,20 @@ 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}`); + const imageID = yield buildx.getImageID(); + if (imageID) { + yield core.group(`Digest output`, () => __awaiter(this, void 0, void 0, function* () { + core.info(imageID); context.setOutput('digest', imageID); - } - if (metadata) { - core.info(`metadata=${metadata}`); + })); + } + const metadata = yield buildx.getMetadata(); + if (metadata) { + yield core.group(`Metadata output`, () => __awaiter(this, void 0, void 0, function* () { + core.info(metadata); context.setOutput('metadata', metadata); - } - })); + })); + } } catch (error) { core.setFailed(error.message); diff --git a/src/main.ts b/src/main.ts index d1ce06d07..ceb4b3660 100644 --- a/src/main.ts +++ b/src/main.ts @@ -33,18 +33,21 @@ 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}`); + const imageID = await buildx.getImageID(); + if (imageID) { + await core.group(`Digest output`, async () => { + core.info(imageID); context.setOutput('digest', imageID); - } - if (metadata) { - core.info(`metadata=${metadata}`); + }); + } + + const metadata = await buildx.getMetadata(); + if (metadata) { + await core.group(`Metadata output`, async () => { + core.info(metadata); context.setOutput('metadata', metadata); - } - }); + }); + } } catch (error) { core.setFailed(error.message); }