fix error message output when pulling image fails

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2024-03-27 14:13:47 +01:00
parent 13c418a7a8
commit aa212840b3
No known key found for this signature in database
GPG Key ID: ADE44D8C9D44FBE4

View File

@ -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 () => {