From aa212840b3f5d75a52b1651527af53a6bb0c814c Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Wed, 27 Mar 2024 14:13:47 +0100 Subject: [PATCH] fix error message output when pulling image fails Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- src/main.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.ts b/src/main.ts index 0026eec..fd39bcf 100644 --- a/src/main.ts +++ b/src/main.ts @@ -20,7 +20,11 @@ actionsToolkit.run( }); await core.group(`Pulling binfmt Docker image`, async () => { - await Exec.exec('docker', ['pull', input.image]); + await Exec.getExecOutput('docker', ['pull', input.image]).then(res => { + if (res.stderr.length > 0 && res.exitCode != 0) { + throw new Error(`cannot pull binfmt image: ${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`); + } + }); }); await core.group(`Image info`, async () => {