mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-03-12 18:07:10 -04:00
fix boolean input
This commit is contained in:
3
dist/index.js
generated
vendored
3
dist/index.js
generated
vendored
@@ -389,7 +389,8 @@ async function run() {
|
||||
const region = core.getInput('aws-region', { required: true });
|
||||
const roleToAssume = core.getInput('role-to-assume', { required: false });
|
||||
const audience = core.getInput('audience', { required: false });
|
||||
const maskAccountId = core.getBooleanInput('mask-aws-account-id', { required: false });
|
||||
const maskAccountIdInput = core.getInput('mask-aws-account-id', { required: false }) || 'false';
|
||||
const maskAccountId = maskAccountIdInput.toLowerCase() === 'true';
|
||||
const roleExternalId = core.getInput('role-external-id', { required: false });
|
||||
const webIdentityTokenFile = core.getInput('web-identity-token-file', { required: false });
|
||||
const roleDuration = parseInt(core.getInput('role-duration-seconds', { required: false })) || DEFAULT_ROLE_DURATION;
|
||||
|
||||
@@ -17,7 +17,8 @@ export async function run() {
|
||||
const region = core.getInput('aws-region', { required: true });
|
||||
const roleToAssume = core.getInput('role-to-assume', { required: false });
|
||||
const audience = core.getInput('audience', { required: false });
|
||||
const maskAccountId = core.getBooleanInput('mask-aws-account-id', { required: false });
|
||||
const maskAccountIdInput = core.getInput('mask-aws-account-id', { required: false }) || 'false';
|
||||
const maskAccountId = maskAccountIdInput.toLowerCase() === 'true';
|
||||
const roleExternalId = core.getInput('role-external-id', { required: false });
|
||||
const webIdentityTokenFile = core.getInput('web-identity-token-file', { required: false });
|
||||
const roleDuration = parseInt(core.getInput('role-duration-seconds', { required: false })) || DEFAULT_ROLE_DURATION;
|
||||
|
||||
@@ -86,7 +86,6 @@ describe('Configure AWS Credentials', () => {
|
||||
mockedSTS.reset();
|
||||
(fromEnv as jest.Mock).mockReset();
|
||||
jest.spyOn(core, 'getMultilineInput').mockImplementation(() => []);
|
||||
jest.spyOn(core, 'getBooleanInput').mockImplementation();
|
||||
jest.spyOn(core, 'getIDToken').mockImplementation(async () => Promise.resolve('testtoken'));
|
||||
jest.spyOn(core, 'exportVariable').mockImplementation();
|
||||
jest.spyOn(core, 'setSecret').mockImplementation();
|
||||
@@ -139,7 +138,7 @@ describe('Configure AWS Credentials', () => {
|
||||
|
||||
expect(mockedSTS.commandCalls(AssumeRoleCommand)).toHaveLength(0);
|
||||
expect(core.exportVariable).toHaveBeenCalledTimes(5);
|
||||
expect(core.setSecret).toHaveBeenCalledTimes(3);
|
||||
expect(core.setSecret).toHaveBeenCalledTimes(4);
|
||||
expect(core.exportVariable).toHaveBeenCalledWith('AWS_ACCESS_KEY_ID', FAKE_ACCESS_KEY_ID);
|
||||
expect(core.setSecret).toHaveBeenCalledWith(FAKE_ACCESS_KEY_ID);
|
||||
expect(core.exportVariable).toHaveBeenCalledWith('AWS_SECRET_ACCESS_KEY', FAKE_SECRET_ACCESS_KEY);
|
||||
@@ -278,7 +277,6 @@ describe('Configure AWS Credentials', () => {
|
||||
test('can opt into masking account ID', async () => {
|
||||
const mockInputs = { ...CREDS_INPUTS, 'aws-region': 'us-east-1', 'mask-aws-account-id': 'true' };
|
||||
jest.spyOn(core, 'getInput').mockImplementation(mockGetInput(mockInputs));
|
||||
jest.spyOn(core, 'getBooleanInput').mockImplementation(() => true);
|
||||
|
||||
await run();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user