1
0
Fork 0
mirror of https://github.com/docker/login-action.git synced 2025-04-22 22:56:36 +02:00

ecr input to specify whether the given registry is ECR

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
This commit is contained in:
CrazyMax 2021-12-20 10:59:11 +01:00
parent b20b9f5e31
commit b9a4d91ee5
No known key found for this signature in database
GPG key ID: 3248E46B6BB8C7F7
8 changed files with 29 additions and 15 deletions

13
dist/index.js generated vendored
View file

@ -160,6 +160,7 @@ function getInputs() {
registry: core.getInput('registry'),
username: core.getInput('username'),
password: core.getInput('password'),
ecr: core.getInput('ecr'),
logout: core.getBooleanInput('logout')
};
}
@ -206,9 +207,9 @@ exports.loginECR = exports.loginStandard = exports.logout = exports.login = void
const aws = __importStar(__nccwpck_require__(35981));
const core = __importStar(__nccwpck_require__(42186));
const exec = __importStar(__nccwpck_require__(71514));
function login(registry, username, password) {
function login(registry, username, password, ecr) {
return __awaiter(this, void 0, void 0, function* () {
if (aws.isECR(registry)) {
if (/true/i.test(ecr) || (ecr == 'auto' && aws.isECR(registry))) {
yield loginECR(registry, username, password);
}
else {
@ -328,10 +329,10 @@ const stateHelper = __importStar(__nccwpck_require__(88647));
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
const { registry, username, password, logout } = context.getInputs();
stateHelper.setRegistry(registry);
stateHelper.setLogout(logout);
yield docker.login(registry, username, password);
const input = context.getInputs();
stateHelper.setRegistry(input.registry);
stateHelper.setLogout(input.logout);
yield docker.login(input.registry, input.username, input.password, input.ecr);
}
catch (error) {
core.setFailed(error.message);