mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-09-04 06:15:07 +09:00
chore: Update dist
This commit is contained in:
Vendored
+11
-3
@@ -268,8 +268,8 @@ function getStsClient(region) {
|
|||||||
async function run() {
|
async function run() {
|
||||||
try {
|
try {
|
||||||
// Get inputs
|
// Get inputs
|
||||||
const accessKeyId = core.getInput('aws-access-key-id', { required: true });
|
const accessKeyId = core.getInput('aws-access-key-id', { required: false });
|
||||||
const secretAccessKey = core.getInput('aws-secret-access-key', { required: true });
|
const secretAccessKey = core.getInput('aws-secret-access-key', { required: false });
|
||||||
const region = core.getInput('aws-region', { required: true });
|
const region = core.getInput('aws-region', { required: true });
|
||||||
const sessionToken = core.getInput('aws-session-token', { required: false });
|
const sessionToken = core.getInput('aws-session-token', { required: false });
|
||||||
const maskAccountId = core.getInput('mask-aws-account-id', { required: false });
|
const maskAccountId = core.getInput('mask-aws-account-id', { required: false });
|
||||||
@@ -278,13 +278,21 @@ async function run() {
|
|||||||
const roleDurationSeconds = core.getInput('role-duration-seconds', {required: false}) || MAX_ACTION_RUNTIME;
|
const roleDurationSeconds = core.getInput('role-duration-seconds', {required: false}) || MAX_ACTION_RUNTIME;
|
||||||
const roleSessionName = core.getInput('role-session-name', { required: false }) || ROLE_SESSION_NAME;
|
const roleSessionName = core.getInput('role-session-name', { required: false }) || ROLE_SESSION_NAME;
|
||||||
|
|
||||||
|
exportRegion(region);
|
||||||
|
|
||||||
// Always export the source credentials and account ID.
|
// Always export the source credentials and account ID.
|
||||||
// The STS client for calling AssumeRole pulls creds from the environment.
|
// The STS client for calling AssumeRole pulls creds from the environment.
|
||||||
// Plus, in the assume role case, if the AssumeRole call fails, we want
|
// Plus, in the assume role case, if the AssumeRole call fails, we want
|
||||||
// the source credentials and accound ID to already be masked as secrets
|
// the source credentials and accound ID to already be masked as secrets
|
||||||
// in any error messages.
|
// in any error messages.
|
||||||
exportRegion(region);
|
if (accessKeyId) {
|
||||||
|
if (!secretAccessKey) {
|
||||||
|
throw new Error("'aws-secret-access-key' must be provided if 'aws-access-key-id' is provided");
|
||||||
|
}
|
||||||
|
|
||||||
exportCredentials({accessKeyId, secretAccessKey, sessionToken});
|
exportCredentials({accessKeyId, secretAccessKey, sessionToken});
|
||||||
|
}
|
||||||
|
|
||||||
const sourceAccountId = await exportAccountId(maskAccountId, region);
|
const sourceAccountId = await exportAccountId(maskAccountId, region);
|
||||||
|
|
||||||
// Get role credentials if configured to do so
|
// Get role credentials if configured to do so
|
||||||
|
|||||||
Reference in New Issue
Block a user