1
0
Fork 0
mirror of https://github.com/docker/login-action.git synced 2025-04-22 14:46:37 +02:00

ecr input to specify whether the given registry is ECR

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2021-12-20 10:59:11 +01:00
parent b20b9f5e31
commit b9a4d91ee5
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
8 changed files with 29 additions and 15 deletions

View file

@ -34,6 +34,9 @@ test('successful with username and password', async () => {
const password: string = 'groundcontrol';
process.env[`INPUT_PASSWORD`] = password;
const ecr: string = 'auto';
process.env['INPUT_ECR'] = ecr;
const logout: boolean = false;
process.env['INPUT_LOGOUT'] = String(logout);
@ -41,7 +44,7 @@ test('successful with username and password', async () => {
expect(setRegistrySpy).toHaveBeenCalledWith('');
expect(setLogoutSpy).toHaveBeenCalledWith(logout);
expect(dockerSpy).toHaveBeenCalledWith('', username, password);
expect(dockerSpy).toHaveBeenCalledWith('', username, password, ecr);
});
test('calls docker login', async () => {
@ -62,6 +65,9 @@ test('calls docker login', async () => {
const registry: string = 'ghcr.io';
process.env[`INPUT_REGISTRY`] = registry;
const ecr: string = 'auto';
process.env['INPUT_ECR'] = ecr;
const logout: boolean = true;
process.env['INPUT_LOGOUT'] = String(logout);
@ -69,5 +75,5 @@ test('calls docker login', async () => {
expect(setRegistrySpy).toHaveBeenCalledWith(registry);
expect(setLogoutSpy).toHaveBeenCalledWith(logout);
expect(dockerSpy).toHaveBeenCalledWith(registry, username, password);
expect(dockerSpy).toHaveBeenCalledWith(registry, username, password, ecr);
});