From 31629f69bf239348b7cdb36f0d9a054bed2fca00 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Fri, 19 Jul 2024 13:01:47 +0200 Subject: [PATCH] switch to Docker exec Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- src/main.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main.ts b/src/main.ts index 7210643..2bc30fe 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,8 +1,8 @@ import * as context from './context'; import * as core from '@actions/core'; import * as actionsToolkit from '@docker/actions-toolkit'; + import {Docker} from '@docker/actions-toolkit/lib/docker/docker'; -import {Exec} from '@docker/actions-toolkit/lib/exec'; interface Platforms { supported: string[]; @@ -20,7 +20,7 @@ actionsToolkit.run( }); await core.group(`Pulling binfmt Docker image`, async () => { - await Exec.getExecOutput('docker', ['pull', input.image], { + await Docker.getExecOutput(['pull', input.image], { ignoreReturnCode: true }).then(res => { if (res.stderr.length > 0 && res.exitCode != 0) { @@ -30,7 +30,7 @@ actionsToolkit.run( }); await core.group(`Image info`, async () => { - await Exec.getExecOutput('docker', ['image', 'inspect', input.image], { + await Docker.getExecOutput(['image', 'inspect', input.image], { ignoreReturnCode: true }).then(res => { if (res.stderr.length > 0 && res.exitCode != 0) { @@ -40,7 +40,7 @@ actionsToolkit.run( }); await core.group(`Installing QEMU static binaries`, async () => { - await Exec.getExecOutput('docker', ['run', '--rm', '--privileged', input.image, '--install', input.platforms], { + await Docker.getExecOutput(['run', '--rm', '--privileged', input.image, '--install', input.platforms], { ignoreReturnCode: true }).then(res => { if (res.stderr.length > 0 && res.exitCode != 0) { @@ -50,7 +50,7 @@ actionsToolkit.run( }); await core.group(`Extracting available platforms`, async () => { - await Exec.getExecOutput('docker', ['run', '--rm', '--privileged', input.image], { + await Docker.getExecOutput(['run', '--rm', '--privileged', input.image], { ignoreReturnCode: true, silent: true }).then(res => {