From 5ce6d03987185783e51cdd2cbc3b2f7c7ab1e5b7 Mon Sep 17 00:00:00 2001 From: GitHub Actions Date: Fri, 6 Mar 2020 22:30:26 +0000 Subject: [PATCH] chore: Update dist --- dist/index.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dist/index.js b/dist/index.js index fc1e81c..086f10a 100644 --- a/dist/index.js +++ b/dist/index.js @@ -137,6 +137,7 @@ const USER_AGENT = 'configure-aws-credentials-for-github-actions'; const MAX_TAG_VALUE_LENGTH = 256; const SANITIZATION_CHARACTER = '_'; const ROLE_SESSION_NAME = 'GitHubActions'; +const REGION_REGEX = /^[a-z0-9-]+$/g; async function assumeRole(params) { // Assume a role to get short-lived credentials using longer-lived credentials. @@ -278,6 +279,10 @@ async function run() { const roleDurationSeconds = core.getInput('role-duration-seconds', {required: false}) || MAX_ACTION_RUNTIME; const roleSessionName = core.getInput('role-session-name', { required: false }) || ROLE_SESSION_NAME; + if (!region.match(REGION_REGEX)) { + throw new Error(`Region is not valid: ${region}`); + } + exportRegion(region); // Always export the source credentials and account ID.