-
Notifications
You must be signed in to change notification settings - Fork 463
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 aws-region optional #689
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 |
---|---|---|
|
@@ -341,6 +341,23 @@ describe('Configure AWS Credentials', () => { | |
expect(core.setFailed).toHaveBeenCalledWith('Region is not valid: $AWS_REGION'); | ||
}); | ||
|
||
test('aws-region should be optional and use AWS_REGION instead', async () => { | ||
const mockInputs = { ...CREDS_INPUTS } | ||
core.getInput = jest.fn().mockImplementation(mockGetInput(mockInputs)) | ||
process.env.AWS_REGION = "fake-region" | ||
await run() | ||
expect(core.exportVariable).toHaveBeenCalledWith("AWS_REGION", "fake-region") | ||
expect(core.exportVariable).toHaveBeenCalledWith("AWS_DEFAULT_REGION", "fake-region") | ||
}) | ||
test('aws-region should be optional and use AWS_DEFAULT_REGION if AWS_REGION is not available', async () => { | ||
const mockInputs = { ...CREDS_INPUTS } | ||
core.getInput = jest.fn().mockImplementation(mockGetInput(mockInputs)) | ||
process.env.AWS_DEFAULT_REGION = "fake-default-region" | ||
await run() | ||
expect(core.exportVariable).toHaveBeenCalledWith("AWS_REGION", "fake-default-region") | ||
expect(core.exportVariable).toHaveBeenCalledWith("AWS_DEFAULT_REGION", "fake-default-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. I'd like two more tests here: One to make sure that when the action input, and both Another test to verify that when both |
||
test('throws error if access key id exists but missing secret access key', async () => { | ||
process.env.SHOW_STACK_TRACE = 'false'; | ||
const inputsWIthoutSecretKey = {...ASSUME_ROLE_INPUTS} | ||
|
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.
Set
required: false
🙂