mirror of
https://github.com/aws-actions/configure-aws-credentials.git
synced 2026-09-02 05:55:10 +09:00
fix to make action still run
This commit is contained in:
@@ -63,7 +63,6 @@ export class CredentialsClient {
|
||||
}
|
||||
|
||||
private async loadCredentials() {
|
||||
info('trying to load credentials');
|
||||
const client = new STSClient({
|
||||
requestHandler: this.requestHandler ? this.requestHandler : undefined,
|
||||
});
|
||||
|
||||
@@ -96,9 +96,7 @@ export function exportRegion(region: string, outputEnvCredentials?: boolean) {
|
||||
// Obtains account ID from STS Client and sets it as output
|
||||
export async function exportAccountId(credentialsClient: CredentialsClient, maskAccountId?: boolean) {
|
||||
const client = credentialsClient.stsClient;
|
||||
core.info('trying to get account id');
|
||||
const identity = await client.send(new GetCallerIdentityCommand({}));
|
||||
core.info('got account id');
|
||||
const accountId = identity.Account;
|
||||
if (!accountId) {
|
||||
throw new Error('Could not get Account ID from STS. Did you set credentials?');
|
||||
|
||||
+3
-3
@@ -203,9 +203,9 @@ export async function run() {
|
||||
if (!process.env.GITHUB_ACTIONS || AccessKeyId) {
|
||||
await credentialsClient.validateCredentials(roleCredentials.Credentials?.AccessKeyId);
|
||||
}
|
||||
core.info(`validated credentials`);
|
||||
await exportAccountId(credentialsClient, maskAccountId);
|
||||
core.info(`exported account id`);
|
||||
if (outputEnvCredentials) {
|
||||
await exportAccountId(credentialsClient, maskAccountId);
|
||||
}
|
||||
} else {
|
||||
core.info('Proceeding with IAM user credentials');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user