Compare commits

...

2 Commits

Author SHA1 Message Date
Frank Villaro-Dixon
fbb09fc0bb
Merge 1e928945a0 into 406e1d7119 2024-05-15 12:58:26 +02:00
Frank Villaro-Dixon
1e928945a0 docker auth: improve missing user/pwd
Specify the "missing username and password" error message. This makes debugging the action easier when for example mistyping the username or the password.

Signed-off-by: Frank Villaro-Dixon <frank@vi-di.fr>
Signed-off-by: Frank Villaro-Dixon <frank@villaro-dixon.eu>
2024-04-30 22:51:23 +02:00

View File

@ -21,9 +21,16 @@ 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);