From 7171cfec433f57f24a98eb454aad6bdf84cad32d 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 --- 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 80ea456d..1124b982 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 8f21f68f..4d48a6d3 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!`); });