From 7ed0556ffafb8eb312463411ef0a84a1dfe24d94 Mon Sep 17 00:00:00 2001 From: CrazyMax <1951866+crazy-max@users.noreply.github.com> Date: Fri, 11 Sep 2026 13:50:42 +0200 Subject: [PATCH] use the shared Buildx error summary helper Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com> --- src/main.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main.ts b/src/main.ts index bf0f2dd..be43b36 100644 --- a/src/main.ts +++ b/src/main.ts @@ -110,11 +110,11 @@ actionsToolkit.run( }).then(res => { if (res.exitCode != 0) { if (inputs.call && inputs.call === 'check' && res.stdout.length > 0) { - // checks warnings are printed to stdout: https://github.com/docker/buildx/pull/2647 - // take the first line with the message summaryzing the warnings + // Check warnings are printed to stdout: https://github.com/docker/buildx/pull/2647 + // Use the first line as the warning summary. err = new Error(res.stdout.split('\n')[0]?.trim()); - } else if (res.stderr.length > 0) { - err = new Error(`buildx failed with: ${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`); + } else { + err = new Error(`buildx failed with: ${Buildx.getErrorMessage(res.stderr)}`); } } });