Skip to content

Commit

Permalink
Merge pull request #41 from crazy-max/fix-public-ecr
Browse files Browse the repository at this point in the history
Fix public ECR login with AWS CLI v1
  • Loading branch information
crazy-max authored Dec 17, 2020
2 parents 3b14bab + f53ca52 commit 7b79d7e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/aws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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}`;
});
Expand Down

0 comments on commit 7b79d7e

Please sign in to comment.