-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make region optional #431
Make region optional #431
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ const MAX_TAG_VALUE_LENGTH = 256; | |
const SANITIZATION_CHARACTER = '_'; | ||
const ROLE_SESSION_NAME = 'GitHubActions'; | ||
const REGION_REGEX = /^[a-z0-9-]+$/g; | ||
const AWS_CURRENT_REGION = process.env.AWS_REGION | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We shouldn't set this as a global variable - instead use |
||
|
||
async function assumeRole(params) { | ||
// Assume a role to get short-lived credentials using longer-lived credentials. | ||
|
@@ -264,7 +265,7 @@ async function run() { | |
// Get inputs | ||
const accessKeyId = core.getInput('aws-access-key-id', { required: false }); | ||
const secretAccessKey = core.getInput('aws-secret-access-key', { required: false }); | ||
const region = core.getInput('aws-region', { required: true }); | ||
const region = core.getInput('aws-region', { required: false }) || AWS_CURRENT_REGION; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Like I mentioned above, we should use To add on to the discussion above regarding |
||
const sessionToken = core.getInput('aws-session-token', { required: false }); | ||
const maskAccountId = core.getInput('mask-aws-account-id', { required: false }); | ||
const roleToAssume = core.getInput('role-to-assume', {required: false}); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or should this be
AWS_DEFAULT_REGION
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think so; you want to be able to override the default region, which is what
AWS_REGION
is for