mirror of
https://github.com/docker/login-action.git
synced 2025-04-19 01:26:45 +00:00
fix(ecr): use ec2 instance credentials when no credentials are provided
Signed-off-by: Markus Maga <markus@maga.se>
This commit is contained in:
parent
1cce1654e0
commit
46ab6d5c3c
2 changed files with 83 additions and 3 deletions
|
@ -62,8 +62,12 @@ export async function loginECR(registry: string, username: string, password: str
|
|||
core.info(`AWS ECR detected with ${region} region`);
|
||||
}
|
||||
|
||||
process.env.AWS_ACCESS_KEY_ID = username || process.env.AWS_ACCESS_KEY_ID;
|
||||
process.env.AWS_SECRET_ACCESS_KEY = password || process.env.AWS_SECRET_ACCESS_KEY;
|
||||
if (username) {
|
||||
process.env.AWS_ACCESS_KEY_ID = username;
|
||||
}
|
||||
if (password) {
|
||||
process.env.AWS_SECRET_ACCESS_KEY = password;
|
||||
}
|
||||
|
||||
core.info(`Retrieving docker login command through AWS CLI ${cliVersion} (${cliPath})...`);
|
||||
const loginCmds = await aws.getDockerLoginCmds(cliVersion, registry, region, accountIDs);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue