3
0
Fork 0
mirror of https://gitea.com/docker/build-push-action.git synced 2024-11-22 09:29:38 +01:00

Merge pull request #559 from crazy-max/outputs

Enhance outputs display
This commit is contained in:
CrazyMax 2022-02-09 11:41:29 +01:00 committed by GitHub
commit fe02965b48
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 20 deletions

22
dist/index.js generated vendored
View file

@ -516,18 +516,20 @@ function run() {
throw new Error(`buildx failed with: ${res.stderr.match(/(.*)\s*$/)[0].trim()}`); 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 imageID = yield buildx.getImageID(); if (imageID) {
const metadata = yield buildx.getMetadata(); yield core.group(`Digest output`, () => __awaiter(this, void 0, void 0, function* () {
if (imageID) { core.info(imageID);
core.info(`digest=${imageID}`);
context.setOutput('digest', 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); context.setOutput('metadata', metadata);
} }));
})); }
} }
catch (error) { catch (error) {
core.setFailed(error.message); core.setFailed(error.message);

View file

@ -33,18 +33,21 @@ async function run(): Promise<void> {
} }
}); });
await core.group(`Setting outputs`, async () => { const imageID = await buildx.getImageID();
const imageID = await buildx.getImageID(); if (imageID) {
const metadata = await buildx.getMetadata(); await core.group(`Digest output`, async () => {
if (imageID) { core.info(imageID);
core.info(`digest=${imageID}`);
context.setOutput('digest', 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); context.setOutput('metadata', metadata);
} });
}); }
} catch (error) { } catch (error) {
core.setFailed(error.message); core.setFailed(error.message);
} }