mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-06-08 15:17:05 +00:00
chore: Update dist
This commit is contained in:
parent
baf85d8be9
commit
740d8a44f8
1 changed files with 17 additions and 11 deletions
28
dist/index.js
vendored
28
dist/index.js
vendored
|
|
@ -155,6 +155,7 @@ async function assumeRole(params) {
|
|||
roleDurationSeconds,
|
||||
roleSessionName,
|
||||
region,
|
||||
roleSkipSessionTagging
|
||||
} = params;
|
||||
assert(
|
||||
[sourceAccountId, roleToAssume, roleDurationSeconds, roleSessionName, region].every(isDefined),
|
||||
|
|
@ -174,20 +175,23 @@ async function assumeRole(params) {
|
|||
// Supports only 'aws' partition. Customers in other partitions ('aws-cn') will need to provide full ARN
|
||||
roleArn = `arn:aws:iam::${sourceAccountId}:role/${roleArn}`;
|
||||
}
|
||||
const tagArray = [
|
||||
{Key: 'GitHub', Value: 'Actions'},
|
||||
{Key: 'Repository', Value: GITHUB_REPOSITORY},
|
||||
{Key: 'Workflow', Value: sanitizeGithubWorkflowName(GITHUB_WORKFLOW)},
|
||||
{Key: 'Action', Value: GITHUB_ACTION},
|
||||
{Key: 'Actor', Value: sanitizeGithubActor(GITHUB_ACTOR)},
|
||||
{Key: 'Branch', Value: GITHUB_REF},
|
||||
{Key: 'Commit', Value: GITHUB_SHA},
|
||||
];
|
||||
|
||||
const roleSessionTags = roleSkipSessionTagging ? undefined : tagArray;
|
||||
|
||||
const assumeRoleRequest = {
|
||||
RoleArn: roleArn,
|
||||
RoleSessionName: roleSessionName,
|
||||
DurationSeconds: roleDurationSeconds,
|
||||
Tags: [
|
||||
{Key: 'GitHub', Value: 'Actions'},
|
||||
{Key: 'Repository', Value: GITHUB_REPOSITORY},
|
||||
{Key: 'Workflow', Value: sanitizeGithubWorkflowName(GITHUB_WORKFLOW)},
|
||||
{Key: 'Action', Value: GITHUB_ACTION},
|
||||
{Key: 'Actor', Value: sanitizeGithubActor(GITHUB_ACTOR)},
|
||||
{Key: 'Branch', Value: GITHUB_REF},
|
||||
{Key: 'Commit', Value: GITHUB_SHA},
|
||||
]
|
||||
Tags: roleSessionTags
|
||||
};
|
||||
|
||||
if (roleExternalId) {
|
||||
|
|
@ -329,7 +333,8 @@ async function run() {
|
|||
const roleExternalId = core.getInput('role-external-id', { required: false });
|
||||
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 roleSkipSessionTagging = core.getInput('role-skip-session-tagging', { required: false });
|
||||
|
||||
if (!region.match(REGION_REGEX)) {
|
||||
throw new Error(`Region is not valid: ${region}`);
|
||||
}
|
||||
|
|
@ -366,7 +371,8 @@ async function run() {
|
|||
roleToAssume,
|
||||
roleExternalId,
|
||||
roleDurationSeconds,
|
||||
roleSessionName
|
||||
roleSessionName,
|
||||
roleSkipSessionTagging
|
||||
});
|
||||
exportCredentials(roleCredentials);
|
||||
await validateCredentials(roleCredentials.accessKeyId);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue