From e1f1c897e856253dc852e0309b1f4add7ccf0b5f Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Tue, 4 Aug 2020 22:27:55 +0000 Subject: [PATCH] chore: Update dist --- dist/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/dist/index.js b/dist/index.js index 27cd46a..a5d23b9 100644 --- a/dist/index.js +++ b/dist/index.js @@ -162,9 +162,9 @@ async function assumeRole(params) { "Missing required input when assuming a Role." ); - const {GITHUB_REPOSITORY, GITHUB_WORKFLOW, GITHUB_ACTION, GITHUB_ACTOR, GITHUB_REF, GITHUB_SHA} = process.env; + const {GITHUB_REPOSITORY, GITHUB_WORKFLOW, GITHUB_ACTION, GITHUB_ACTOR, GITHUB_SHA} = process.env; assert( - [GITHUB_REPOSITORY, GITHUB_WORKFLOW, GITHUB_ACTION, GITHUB_ACTOR, GITHUB_REF, GITHUB_SHA].every(isDefined), + [GITHUB_REPOSITORY, GITHUB_WORKFLOW, GITHUB_ACTION, GITHUB_ACTOR, GITHUB_SHA].every(isDefined), 'Missing required environment value. Are you running in GitHub Actions?' ); @@ -181,10 +181,13 @@ async function assumeRole(params) { {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}, ]; + if (isDefined(process.env.GITHUB_REF)) { + tagArray.push({Key: 'Branch', Value: process.env.GITHUB_REF}); + } + const roleSessionTags = roleSkipSessionTagging ? undefined : tagArray; const assumeRoleRequest = {