Skip to content

Commit aeb7571

Browse files
committed
fix to make action still run
1 parent 7a01614 commit aeb7571

File tree

6 files changed

+7
-15
lines changed

6 files changed

+7
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ See [action.yml](./action.yml) for more detail.
112112
| inline-session-policy | You may further restrict the assumed role policy by defining an inline policy here. | No |
113113
| managed-session-policies | You may further restrict the assumed role policy by specifying a managed policy here. | No |
114114
| output-credentials | When set, outputs fetched credentials as action step output. (Outputs access-key-id, secret-access-key, session-token, and expiration). Defaults to false. | No |
115-
| output-env-credentials | When set, exports fetched credentials as environment variables (AWS_REGION, AWS_DEFAULT_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN). Defaults to true. Set to false if you need to avoid setting/changing env variables. (You'd probably want to use output-credentials if you disable this). | No |
115+
| output-env-credentials | When set, outputs fetched credentials as environment variables (AWS_REGION, AWS_DEFAULT_REGION, AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN). Defaults to true. Set to false if you need to avoid setting/changing env variables. You'd probably want to use output-credentials if you disable this. (NOTE: Setting to false will prevent the aws-account-id from being exported as a step output). | No |
116116
| unset-current-credentials | When set, attempts to unset any existing credentials in your action runner. | No |
117117
| disable-retry | Disabled retry/backoff logic for assume role calls. By default, retries are enabled. | No |
118118
| retry-max-attempts | Limits the number of retry attempts before giving up. Defaults to 12. | No |

dist/cleanup/index.js

Lines changed: 0 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/index.js

Lines changed: 3 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/CredentialsClient.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ export class CredentialsClient {
6363
}
6464

6565
private async loadCredentials() {
66-
info('trying to load credentials');
6766
const client = new STSClient({
6867
requestHandler: this.requestHandler ? this.requestHandler : undefined,
6968
});

src/helpers.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,7 @@ export function exportRegion(region: string, outputEnvCredentials?: boolean) {
9696
// Obtains account ID from STS Client and sets it as output
9797
export async function exportAccountId(credentialsClient: CredentialsClient, maskAccountId?: boolean) {
9898
const client = credentialsClient.stsClient;
99-
core.info('trying to get account id');
10099
const identity = await client.send(new GetCallerIdentityCommand({}));
101-
core.info('got account id');
102100
const accountId = identity.Account;
103101
if (!accountId) {
104102
throw new Error('Could not get Account ID from STS. Did you set credentials?');

src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,9 +203,9 @@ export async function run() {
203203
if (!process.env.GITHUB_ACTIONS || AccessKeyId) {
204204
await credentialsClient.validateCredentials(roleCredentials.Credentials?.AccessKeyId);
205205
}
206-
core.info(`validated credentials`);
207-
await exportAccountId(credentialsClient, maskAccountId);
208-
core.info(`exported account id`);
206+
if (outputEnvCredentials) {
207+
await exportAccountId(credentialsClient, maskAccountId);
208+
}
209209
} else {
210210
core.info('Proceeding with IAM user credentials');
211211
}

0 commit comments

Comments
 (0)