Skip to content

Commit 2e3c143

Browse files
committed
modify the logic and fix the unit tests
1 parent 21a315f commit 2e3c143

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

dist/index.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ async function run() {
204204
const roleDurationSeconds = core.getInput('role-duration-seconds', {required: false}) || MAX_ACTION_RUNTIME;
205205
const roleSessionName = core.getInput('role-session-name', { required: false }) || ROLE_SESSION_NAME;
206206
const roleSkipSessionTaggingInput = core.getInput('role-skip-session-tagging', { required: false })|| 'false';
207-
const roleSkipSessionTagging = roleSkipSessionTaggingInput === true || roleSkipSessionTaggingInput.toLowerCase() === 'true';
207+
const roleSkipSessionTagging = roleSkipSessionTaggingInput.toLowerCase() === 'true';
208208

209209
if (!region.match(REGION_REGEX)) {
210210
throw new Error(`Region is not valid: ${region}`);

index.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ describe('Configure AWS Credentials', () => {
559559
test('skip tagging provided as true', async () => {
560560
core.getInput = jest
561561
.fn()
562-
.mockImplementation(mockGetInput({...ASSUME_ROLE_INPUTS, 'role-skip-session-tagging': true}));
562+
.mockImplementation(mockGetInput({...ASSUME_ROLE_INPUTS, 'role-skip-session-tagging': 'true'}));
563563

564564
await run();
565565
expect(mockStsAssumeRole).toHaveBeenCalledWith({
@@ -573,7 +573,7 @@ describe('Configure AWS Credentials', () => {
573573
test('skip tagging provided as false', async () => {
574574
core.getInput = jest
575575
.fn()
576-
.mockImplementation(mockGetInput({...ASSUME_ROLE_INPUTS, 'role-skip-session-tagging': false}));
576+
.mockImplementation(mockGetInput({...ASSUME_ROLE_INPUTS, 'role-skip-session-tagging': 'false'}));
577577

578578
await run();
579579
expect(mockStsAssumeRole).toHaveBeenCalledWith({

0 commit comments

Comments
 (0)