diff --git a/dist/index.js b/dist/index.js index 0b7bfa53..94330732 100644 --- a/dist/index.js +++ b/dist/index.js @@ -4204,7 +4204,7 @@ exports.parseCLIVersion = (stdout) => __awaiter(void 0, void 0, void 0, function }); exports.getDockerLoginCmd = (cliVersion, registry, region) => __awaiter(void 0, void 0, void 0, function* () { let ecrCmd = (yield exports.isPubECR(registry)) ? 'ecr-public' : 'ecr'; - if (semver.satisfies(cliVersion, '>=2.0.0')) { + if (semver.satisfies(cliVersion, '>=2.0.0') || (yield exports.isPubECR(registry))) { return exports.execCLI([ecrCmd, 'get-login-password', '--region', region]).then(pwd => { return `docker login --username AWS --password ${pwd} ${registry}`; }); diff --git a/src/aws.ts b/src/aws.ts index c6aa9c76..24cebe62 100644 --- a/src/aws.ts +++ b/src/aws.ts @@ -47,7 +47,7 @@ export const parseCLIVersion = async (stdout: string): Promise => { export const getDockerLoginCmd = async (cliVersion: string, registry: string, region: string): Promise => { 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}`; });