mirror of
https://github.com/docker/login-action.git
synced 2025-09-10 07:41:33 +08:00
test
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
parent
b614728cdc
commit
8474404dec
2
dist/index.js
generated
vendored
2
dist/index.js
generated
vendored
File diff suppressed because one or more lines are too long
2
dist/index.js.map
generated
vendored
2
dist/index.js.map
generated
vendored
File diff suppressed because one or more lines are too long
@ -36,11 +36,7 @@ export async function loginStandard(registry: string, username: string, password
|
||||
loginArgs.push('--username', username);
|
||||
loginArgs.push(registry);
|
||||
|
||||
if (registry) {
|
||||
core.info(`Logging into ${registry}...`);
|
||||
} else {
|
||||
core.info(`Logging into Docker Hub...`);
|
||||
}
|
||||
core.info(`Logging into ${registry}...`);
|
||||
await Docker.getExecOutput(loginArgs, {
|
||||
ignoreReturnCode: true,
|
||||
silent: true,
|
||||
|
@ -7,10 +7,10 @@ import * as docker from './docker';
|
||||
import * as stateHelper from './state-helper';
|
||||
|
||||
interface Auth {
|
||||
registry: string;
|
||||
registry?: string;
|
||||
username: string;
|
||||
password: string;
|
||||
ecr: string;
|
||||
ecr?: string;
|
||||
}
|
||||
|
||||
export async function main(): Promise<void> {
|
||||
@ -28,6 +28,7 @@ export async function main(): Promise<void> {
|
||||
}
|
||||
|
||||
const add = yaml.load(inputs.add) as Auth[];
|
||||
core.info(`add: ${JSON.stringify(add, null, 2)}`);
|
||||
if (Array.isArray(add)) {
|
||||
auths.push(...add);
|
||||
}
|
||||
@ -46,11 +47,11 @@ export async function main(): Promise<void> {
|
||||
throw new Error('No registry to login');
|
||||
}
|
||||
if (auths.length === 1) {
|
||||
await docker.login(auths[0].registry, auths[0].username, auths[0].password, auths[0].ecr || 'auto');
|
||||
await docker.login(auths[0].registry || 'docker.io', auths[0].username, auths[0].password, auths[0].ecr || 'auto');
|
||||
} else {
|
||||
for (const auth of auths) {
|
||||
await core.group(`Login to ${auth.registry || 'docker.io'}`, async () => {
|
||||
await docker.login(auth.registry, auth.username, auth.password, auth.ecr || 'auto');
|
||||
await docker.login(auth.registry || 'docker.io', auth.username, auth.password, auth.ecr || 'auto');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user