From 431bb0e5e3ae314094c77bbae85220d8d826f591 Mon Sep 17 00:00:00 2001 From: Michael Lehmann Date: Thu, 24 Apr 2025 14:14:16 -0700 Subject: [PATCH] Add Expiration field to output --- src/helpers.ts | 3 +++ test/helpers.test.ts | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/helpers.ts b/src/helpers.ts index 2bc87d0..1d1f303 100644 --- a/src/helpers.ts +++ b/src/helpers.ts @@ -38,6 +38,9 @@ export function exportCredentials(creds?: Partial, outputCredential if (creds?.SessionToken) { core.setOutput('aws-session-token', creds.SessionToken); } + if (creds?.Expiration) { + core.setOutput('aws-expiration', creds.Expiration); + } } } diff --git a/test/helpers.test.ts b/test/helpers.test.ts index f128251..96cb6a7 100644 --- a/test/helpers.test.ts +++ b/test/helpers.test.ts @@ -27,8 +27,8 @@ describe('Configure AWS Credentials helpers', {}, () => { vi.spyOn(core, 'setOutput').mockImplementation(() => {}); vi.spyOn(core, 'setSecret').mockImplementation(() => {}); vi.spyOn(core, 'exportVariable').mockImplementation(() => {}); - helpers.exportCredentials({ AccessKeyId: 'test', SecretAccessKey: 'test', SessionToken: 'test' }, true); - expect(core.setOutput).toHaveBeenCalledTimes(3); + helpers.exportCredentials({ AccessKeyId: 'test', SecretAccessKey: 'test', SessionToken: 'test', Expiration: new Date(8640000000000000) }, true); + expect(core.setOutput).toHaveBeenCalledTimes(4); expect(core.setSecret).toHaveBeenCalledTimes(3); expect(core.exportVariable).toHaveBeenCalledTimes(3); });