mirror of
https://github.com/docker/login-action.git
synced 2024-11-22 00:10:57 -05:00
Retrieve command
This commit is contained in:
parent
da3da99964
commit
26618cd0df
2 changed files with 16 additions and 4 deletions
8
dist/index.js
generated
vendored
8
dist/index.js
generated
vendored
|
@ -1095,13 +1095,19 @@ function run() {
|
|||
const ecrRegion = yield ecr.getRegion(registry);
|
||||
process.env.AWS_ACCESS_KEY_ID = username;
|
||||
process.env.AWS_SECRET_ACCESS_KEY = password;
|
||||
core.info(`🔑 Logging into AWS ECR region ${ecrRegion}...`);
|
||||
core.info(`⬇️ Retrieving docker login command for ECR region ${ecrRegion}...`);
|
||||
yield execm.exec('aws', ['ecr', 'get-login', '--region', ecrRegion, '--no-include-email'], true).then(res => {
|
||||
if (res.stderr != '' && !res.success) {
|
||||
throw new Error(res.stderr);
|
||||
}
|
||||
core.info(`🔑 Logging into ${registry}...`);
|
||||
execm.exec(res.stdout, [], true).then(res => {
|
||||
if (res.stderr != '' && !res.success) {
|
||||
throw new Error(res.stderr);
|
||||
}
|
||||
core.info('🎉 Login Succeeded!');
|
||||
});
|
||||
});
|
||||
}
|
||||
else {
|
||||
let loginArgs = ['login', '--password', password];
|
||||
|
|
|
@ -26,13 +26,19 @@ async function run(): Promise<void> {
|
|||
process.env.AWS_ACCESS_KEY_ID = username;
|
||||
process.env.AWS_SECRET_ACCESS_KEY = password;
|
||||
|
||||
core.info(`🔑 Logging into AWS ECR region ${ecrRegion}...`);
|
||||
core.info(`⬇️ Retrieving docker login command for ECR region ${ecrRegion}...`);
|
||||
await execm.exec('aws', ['ecr', 'get-login', '--region', ecrRegion, '--no-include-email'], true).then(res => {
|
||||
if (res.stderr != '' && !res.success) {
|
||||
throw new Error(res.stderr);
|
||||
}
|
||||
core.info(`🔑 Logging into ${registry}...`);
|
||||
execm.exec(res.stdout, [], true).then(res => {
|
||||
if (res.stderr != '' && !res.success) {
|
||||
throw new Error(res.stderr);
|
||||
}
|
||||
core.info('🎉 Login Succeeded!');
|
||||
});
|
||||
});
|
||||
} else {
|
||||
let loginArgs: Array<string> = ['login', '--password', password];
|
||||
if (username) {
|
||||
|
|
Loading…
Reference in a new issue