mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-09-02 05:55:10 +09:00
feat: Recommending using OIDC (#871)
* Recommending using OIDC * Added tests * fix test and package * update readme --------- Co-authored-by: peterwoodworth <woodwoop@amazon.com>
This commit is contained in:
@@ -56,6 +56,12 @@ async function assumeRoleWithWebIdentityTokenFile(
|
||||
|
||||
async function assumeRoleWithCredentials(params: AssumeRoleCommandInput, client: STSClient) {
|
||||
core.info('Assuming role with user credentials');
|
||||
if (!process.env['AWS_SESSION_TOKEN']) {
|
||||
core.warning(
|
||||
'To avoid using long-term AWS credentials, please update your workflows to authenticate using OpenID Connect.' +
|
||||
' See https://s12d.com/gha-oidc-aws for more information.'
|
||||
);
|
||||
}
|
||||
try {
|
||||
const creds = await client.send(new AssumeRoleCommand({ ...params }));
|
||||
return creds;
|
||||
|
||||
Reference in New Issue
Block a user