From 19329d1409a60b24a1d347660617b17ca258686d Mon Sep 17 00:00:00 2001 From: eine Date: Wed, 4 Nov 2020 19:17:53 +0100 Subject: [PATCH] fix: print non-empty stderr Signed-off-by: eine --- dist/index.js | 9 +++++++-- src/docker.ts | 8 ++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/dist/index.js b/dist/index.js index 80ea456..1124b98 100644 --- a/dist/index.js +++ b/dist/index.js @@ -242,8 +242,13 @@ function loginStandard(registry, username, password) { input: Buffer.from(password) }) .then(res => { - if (res.stderr.length > 0 && res.exitCode != 0) { - throw new Error(res.stderr.trim()); + if (res.stderr.length > 0) { + if (res.exitCode != 0) { + throw new Error(res.stderr.trim()); + } + else { + core.warning(res.stderr); + } } core.info(`Login Succeeded!`); }); diff --git a/src/docker.ts b/src/docker.ts index 8f21f68..4d48a6d 100644 --- a/src/docker.ts +++ b/src/docker.ts @@ -43,8 +43,12 @@ export async function loginStandard(registry: string, username: string, password input: Buffer.from(password) }) .then(res => { - if (res.stderr.length > 0 && res.exitCode != 0) { - throw new Error(res.stderr.trim()); + if (res.stderr.length > 0) { + if (res.exitCode != 0) { + throw new Error(res.stderr.trim()); + } else { + core.warning(res.stderr); + } } core.info(`Login Succeeded!`); });