mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-09-02 05:55:10 +09:00
Add Expiration field to output
This commit is contained in:
@@ -38,6 +38,9 @@ export function exportCredentials(creds?: Partial<Credentials>, outputCredential
|
|||||||
if (creds?.SessionToken) {
|
if (creds?.SessionToken) {
|
||||||
core.setOutput('aws-session-token', creds.SessionToken);
|
core.setOutput('aws-session-token', creds.SessionToken);
|
||||||
}
|
}
|
||||||
|
if (creds?.Expiration) {
|
||||||
|
core.setOutput('aws-expiration', creds.Expiration);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ describe('Configure AWS Credentials helpers', {}, () => {
|
|||||||
vi.spyOn(core, 'setOutput').mockImplementation(() => {});
|
vi.spyOn(core, 'setOutput').mockImplementation(() => {});
|
||||||
vi.spyOn(core, 'setSecret').mockImplementation(() => {});
|
vi.spyOn(core, 'setSecret').mockImplementation(() => {});
|
||||||
vi.spyOn(core, 'exportVariable').mockImplementation(() => {});
|
vi.spyOn(core, 'exportVariable').mockImplementation(() => {});
|
||||||
helpers.exportCredentials({ AccessKeyId: 'test', SecretAccessKey: 'test', SessionToken: 'test' }, true);
|
helpers.exportCredentials({ AccessKeyId: 'test', SecretAccessKey: 'test', SessionToken: 'test', Expiration: new Date(8640000000000000) }, true);
|
||||||
expect(core.setOutput).toHaveBeenCalledTimes(3);
|
expect(core.setOutput).toHaveBeenCalledTimes(4);
|
||||||
expect(core.setSecret).toHaveBeenCalledTimes(3);
|
expect(core.setSecret).toHaveBeenCalledTimes(3);
|
||||||
expect(core.exportVariable).toHaveBeenCalledTimes(3);
|
expect(core.exportVariable).toHaveBeenCalledTimes(3);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user