Skip to content

Commit 423f4e1

Browse files
committed
Add Expiration field to output
1 parent 11e58be commit 423f4e1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/helpers.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ export function exportCredentials(creds?: Partial<Credentials>, outputCredential
3838
if (creds?.SessionToken) {
3939
core.setOutput('aws-session-token', creds.SessionToken);
4040
}
41+
if (creds?.Expiration) {
42+
core.setOutput('aws-expiration', creds.Expiration);
43+
}
4144
}
4245
}
4346

test/helpers.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ describe('Configure AWS Credentials helpers', {}, () => {
2727
vi.spyOn(core, 'setOutput').mockImplementation(() => {});
2828
vi.spyOn(core, 'setSecret').mockImplementation(() => {});
2929
vi.spyOn(core, 'exportVariable').mockImplementation(() => {});
30-
helpers.exportCredentials({ AccessKeyId: 'test', SecretAccessKey: 'test', SessionToken: 'test' }, true);
31-
expect(core.setOutput).toHaveBeenCalledTimes(3);
30+
helpers.exportCredentials({ AccessKeyId: 'test', SecretAccessKey: 'test', SessionToken: 'test', Expiration: new Date(8640000000000000) }, true);
31+
expect(core.setOutput).toHaveBeenCalledTimes(4);
3232
expect(core.setSecret).toHaveBeenCalledTimes(3);
3333
expect(core.exportVariable).toHaveBeenCalledTimes(3);
3434
});

0 commit comments

Comments
 (0)