mirror of
https://github.com/docker/login-action.git
synced 2025-04-20 01:56:45 +00:00
Get AccountID from registry URL and handle ECR registry through regexp
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
parent
d3160f671f
commit
24646ef465
5 changed files with 122 additions and 34 deletions
|
@ -44,6 +44,7 @@ export async function loginECR(registry: string, username: string, password: str
|
|||
const cliPath = await aws.getCLI();
|
||||
const cliVersion = await aws.getCLIVersion();
|
||||
const region = await aws.getRegion(registry);
|
||||
const accountIDs = await aws.getAccountIDs(registry);
|
||||
|
||||
if (await aws.isPubECR(registry)) {
|
||||
core.info(`💡 AWS Public ECR detected with ${region} region`);
|
||||
|
@ -55,7 +56,7 @@ export async function loginECR(registry: string, username: string, password: str
|
|||
process.env.AWS_SECRET_ACCESS_KEY = password || process.env.AWS_SECRET_ACCESS_KEY;
|
||||
|
||||
core.info(`⬇️ Retrieving docker login command through AWS CLI ${cliVersion} (${cliPath})...`);
|
||||
const loginCmds = await aws.getDockerLoginCmds(cliVersion, registry, region);
|
||||
const loginCmds = await aws.getDockerLoginCmds(cliVersion, registry, region, accountIDs);
|
||||
|
||||
core.info(`🔑 Logging into ${registry}...`);
|
||||
loginCmds.forEach((loginCmd, index) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue