mirror of
https://github.com/docker/login-action.git
synced 2025-06-24 03:57:58 +02:00
Fix public ECR login with AWS CLI v1
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
@ -47,7 +47,7 @@ export const parseCLIVersion = async (stdout: string): Promise<string> => {
|
||||
|
||||
export const getDockerLoginCmd = async (cliVersion: string, registry: string, region: string): Promise<string> => {
|
||||
let ecrCmd = (await isPubECR(registry)) ? 'ecr-public' : 'ecr';
|
||||
if (semver.satisfies(cliVersion, '>=2.0.0')) {
|
||||
if (semver.satisfies(cliVersion, '>=2.0.0') || (await isPubECR(registry))) {
|
||||
return execCLI([ecrCmd, 'get-login-password', '--region', region]).then(pwd => {
|
||||
return `docker login --username AWS --password ${pwd} ${registry}`;
|
||||
});
|
||||
|
Reference in New Issue
Block a user