Skip to content

Commit

Permalink
Merge pull request #706 from Frankkkkk/patch-1
Browse files Browse the repository at this point in the history
docker auth: improve missing user/pwd
  • Loading branch information
crazy-max authored May 27, 2024
2 parents 70fccc7 + bfd28af commit db77945
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

8 changes: 7 additions & 1 deletion src/docker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@ export async function logout(registry: string): Promise<void> {
}

export async function loginStandard(registry: string, username: string, password: string): Promise<void> {
if (!username || !password) {
if (!username && !password) {
throw new Error('Username and password required');
}
if (!username) {
throw new Error('Username required');
}
if (!password) {
throw new Error('Password required');
}

const loginArgs: Array<string> = ['login', '--password-stdin'];
loginArgs.push('--username', username);
Expand Down

0 comments on commit db77945

Please sign in to comment.