Skip to content

Commit fa51f3c

Browse files
committed
Fix conflicts from #92
1 parent e65c3ee commit fa51f3c

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

index.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,13 @@ async function assumeRole(params) {
4848
{Key: 'Workflow', Value: sanitizeGithubWorkflowName(GITHUB_WORKFLOW)},
4949
{Key: 'Action', Value: GITHUB_ACTION},
5050
{Key: 'Actor', Value: sanitizeGithubActor(GITHUB_ACTOR)},
51-
{Key: 'Branch', Value: GITHUB_REF},
5251
{Key: 'Commit', Value: GITHUB_SHA},
5352
];
5453

54+
if (isDefined(process.env.GITHUB_REF)) {
55+
tagArray.push({Key: 'Branch', Value: process.env.GITHUB_REF});
56+
}
57+
5558
const roleSessionTags = roleSkipSessionTagging ? undefined : tagArray;
5659

5760
const assumeRoleRequest = {
@@ -61,10 +64,6 @@ async function assumeRole(params) {
6164
Tags: roleSessionTags
6265
};
6366

64-
if (isDefined(process.env.GITHUB_REF)) {
65-
assumeRoleRequest.Tags.push({Key: 'Branch', Value: process.env.GITHUB_REF});
66-
}
67-
6867
if (roleExternalId) {
6968
assumeRoleRequest.ExternalId = roleExternalId;
7069
}

index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,8 +586,8 @@ describe('Configure AWS Credentials', () => {
586586
{Key: 'Workflow', Value: ENVIRONMENT_VARIABLE_OVERRIDES.GITHUB_WORKFLOW},
587587
{Key: 'Action', Value: ENVIRONMENT_VARIABLE_OVERRIDES.GITHUB_ACTION},
588588
{Key: 'Actor', Value: GITHUB_ACTOR_SANITIZED},
589-
{Key: 'Branch', Value: ENVIRONMENT_VARIABLE_OVERRIDES.GITHUB_REF},
590589
{Key: 'Commit', Value: ENVIRONMENT_VARIABLE_OVERRIDES.GITHUB_SHA},
590+
{Key: 'Branch', Value: ENVIRONMENT_VARIABLE_OVERRIDES.GITHUB_REF},
591591
]
592592
})
593593
});
@@ -608,8 +608,8 @@ describe('Configure AWS Credentials', () => {
608608
{Key: 'Workflow', Value: ENVIRONMENT_VARIABLE_OVERRIDES.GITHUB_WORKFLOW},
609609
{Key: 'Action', Value: ENVIRONMENT_VARIABLE_OVERRIDES.GITHUB_ACTION},
610610
{Key: 'Actor', Value: GITHUB_ACTOR_SANITIZED},
611-
{Key: 'Branch', Value: ENVIRONMENT_VARIABLE_OVERRIDES.GITHUB_REF},
612611
{Key: 'Commit', Value: ENVIRONMENT_VARIABLE_OVERRIDES.GITHUB_SHA},
612+
{Key: 'Branch', Value: ENVIRONMENT_VARIABLE_OVERRIDES.GITHUB_REF},
613613
]
614614
})
615615
});

0 commit comments

Comments
 (0)