Skip to content

Commit

Permalink
fix: print non-empty stderr
Browse files Browse the repository at this point in the history
Signed-off-by: eine <eine@users.noreply.github.com>
  • Loading branch information
eine committed Nov 21, 2021
1 parent 1cce165 commit 19329d1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
9 changes: 7 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions src/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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!`);
});
Expand Down

0 comments on commit 19329d1

Please sign in to comment.