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
+14
-8
@@ -155,6 +155,7 @@ async function assumeRole(params) {
|
|||||||
roleDurationSeconds,
|
roleDurationSeconds,
|
||||||
roleSessionName,
|
roleSessionName,
|
||||||
region,
|
region,
|
||||||
|
roleSkipSessionTagging
|
||||||
} = params;
|
} = params;
|
||||||
assert(
|
assert(
|
||||||
[sourceAccountId, roleToAssume, roleDurationSeconds, roleSessionName, region].every(isDefined),
|
[sourceAccountId, roleToAssume, roleDurationSeconds, roleSessionName, region].every(isDefined),
|
||||||
@@ -174,12 +175,7 @@ async function assumeRole(params) {
|
|||||||
// Supports only 'aws' partition. Customers in other partitions ('aws-cn') will need to provide full ARN
|
// Supports only 'aws' partition. Customers in other partitions ('aws-cn') will need to provide full ARN
|
||||||
roleArn = `arn:aws:iam::${sourceAccountId}:role/${roleArn}`;
|
roleArn = `arn:aws:iam::${sourceAccountId}:role/${roleArn}`;
|
||||||
}
|
}
|
||||||
|
const tagArray = [
|
||||||
const assumeRoleRequest = {
|
|
||||||
RoleArn: roleArn,
|
|
||||||
RoleSessionName: roleSessionName,
|
|
||||||
DurationSeconds: roleDurationSeconds,
|
|
||||||
Tags: [
|
|
||||||
{Key: 'GitHub', Value: 'Actions'},
|
{Key: 'GitHub', Value: 'Actions'},
|
||||||
{Key: 'Repository', Value: GITHUB_REPOSITORY},
|
{Key: 'Repository', Value: GITHUB_REPOSITORY},
|
||||||
{Key: 'Workflow', Value: sanitizeGithubWorkflowName(GITHUB_WORKFLOW)},
|
{Key: 'Workflow', Value: sanitizeGithubWorkflowName(GITHUB_WORKFLOW)},
|
||||||
@@ -187,7 +183,15 @@ async function assumeRole(params) {
|
|||||||
{Key: 'Actor', Value: sanitizeGithubActor(GITHUB_ACTOR)},
|
{Key: 'Actor', Value: sanitizeGithubActor(GITHUB_ACTOR)},
|
||||||
{Key: 'Branch', Value: GITHUB_REF},
|
{Key: 'Branch', Value: GITHUB_REF},
|
||||||
{Key: 'Commit', Value: GITHUB_SHA},
|
{Key: 'Commit', Value: GITHUB_SHA},
|
||||||
]
|
];
|
||||||
|
|
||||||
|
const roleSessionTags = roleSkipSessionTagging ? undefined : tagArray;
|
||||||
|
|
||||||
|
const assumeRoleRequest = {
|
||||||
|
RoleArn: roleArn,
|
||||||
|
RoleSessionName: roleSessionName,
|
||||||
|
DurationSeconds: roleDurationSeconds,
|
||||||
|
Tags: roleSessionTags
|
||||||
};
|
};
|
||||||
|
|
||||||
if (roleExternalId) {
|
if (roleExternalId) {
|
||||||
@@ -329,6 +333,7 @@ async function run() {
|
|||||||
const roleExternalId = core.getInput('role-external-id', { required: false });
|
const roleExternalId = core.getInput('role-external-id', { required: false });
|
||||||
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;
|
||||||
|
const roleSkipSessionTagging = core.getInput('role-skip-session-tagging', { required: false });
|
||||||
|
|
||||||
if (!region.match(REGION_REGEX)) {
|
if (!region.match(REGION_REGEX)) {
|
||||||
throw new Error(`Region is not valid: ${region}`);
|
throw new Error(`Region is not valid: ${region}`);
|
||||||
@@ -366,7 +371,8 @@ async function run() {
|
|||||||
roleToAssume,
|
roleToAssume,
|
||||||
roleExternalId,
|
roleExternalId,
|
||||||
roleDurationSeconds,
|
roleDurationSeconds,
|
||||||
roleSessionName
|
roleSessionName,
|
||||||
|
roleSkipSessionTagging
|
||||||
});
|
});
|
||||||
exportCredentials(roleCredentials);
|
exportCredentials(roleCredentials);
|
||||||
await validateCredentials(roleCredentials.accessKeyId);
|
await validateCredentials(roleCredentials.accessKeyId);
|
||||||
|
|||||||
Reference in New Issue
Block a user