mirror of
https://github.com/docker/login-action.git
synced 2025-08-17 09:39:53 +08:00
support dual-stack for aws public ecr
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
This commit is contained in:
@@ -6,13 +6,14 @@ import {HttpProxyAgent} from 'http-proxy-agent';
|
||||
import {HttpsProxyAgent} from 'https-proxy-agent';
|
||||
|
||||
const ecrRegistryRegex = /^(([0-9]{12})\.(dkr\.ecr|dkr-ecr)\.(.+)\.(on\.aws|amazonaws\.com(.cn)?))(\/([^:]+)(:.+)?)?$/;
|
||||
const ecrPublicRegistryRegex = /public\.ecr\.aws|ecr-public\.aws\.com/;
|
||||
|
||||
export const isECR = (registry: string): boolean => {
|
||||
return ecrRegistryRegex.test(registry) || isPubECR(registry);
|
||||
};
|
||||
|
||||
export const isPubECR = (registry: string): boolean => {
|
||||
return registry === 'public.ecr.aws';
|
||||
return ecrPublicRegistryRegex.test(registry);
|
||||
};
|
||||
|
||||
export const getRegion = (registry: string): string => {
|
||||
|
Reference in New Issue
Block a user