mirror of
https://github.com/docker/login-action.git
synced 2024-12-19 22:59:07 +00:00
af023e8f62
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
22 lines
611 B
TypeScript
22 lines
611 B
TypeScript
import * as actionsToolkit from '@docker/actions-toolkit';
|
|
|
|
import * as context from './context';
|
|
import * as docker from './docker';
|
|
import * as stateHelper from './state-helper';
|
|
|
|
export async function main(): Promise<void> {
|
|
const input: context.Inputs = context.getInputs();
|
|
stateHelper.setRegistry(input.registry);
|
|
stateHelper.setLogout(input.logout);
|
|
await docker.login(input.registry, input.username, input.password, input.ecr);
|
|
}
|
|
|
|
async function post(): Promise<void> {
|
|
if (!stateHelper.logout) {
|
|
return;
|
|
}
|
|
await docker.logout(stateHelper.registry);
|
|
}
|
|
|
|
actionsToolkit.run(main, post);
|