mirror of
https://github.com/docker/login-action.git
synced 2025-04-20 01:56:45 +00:00
Take the password from stdin
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
53f337dbae
commit
6e236fe59d
3 changed files with 15 additions and 8 deletions
|
@ -19,7 +19,7 @@ export async function logout(registry: string): Promise<void> {
|
|||
}
|
||||
|
||||
export async function loginStandard(registry: string, username: string, password: string): Promise<void> {
|
||||
let loginArgs: Array<string> = ['login', '--password', password];
|
||||
let loginArgs: Array<string> = ['login', '--password-stdin'];
|
||||
if (username) {
|
||||
loginArgs.push('--username', username);
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ export async function loginStandard(registry: string, username: string, password
|
|||
} else {
|
||||
core.info(`🔑 Logging into DockerHub...`);
|
||||
}
|
||||
await execm.exec('docker', loginArgs, true).then(res => {
|
||||
await execm.exec('docker', loginArgs, true, password).then(res => {
|
||||
if (res.stderr != '' && !res.success) {
|
||||
throw new Error(res.stderr);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue