diff --git a/dist/index.js b/dist/index.js index 50bf61f..5f44b94 100644 --- a/dist/index.js +++ b/dist/index.js @@ -78155,11 +78155,13 @@ async function run() { sourceAccountId = await withRetry(() => exportAccountId(credentialsClient, maskAccountId), "exportAccountId"); } if (AccessKeyId || roleChaining) { - await withRetry( - () => credentialsClient.validateCredentials(AccessKeyId, roleChaining, expectedAccountIds), - "validateCredentials" - ); - sourceAccountId = await withRetry(() => exportAccountId(credentialsClient, maskAccountId), "exportAccountId"); + if (outputEnvCredentials) { + await withRetry( + () => credentialsClient.validateCredentials(AccessKeyId, roleChaining, expectedAccountIds), + "validateCredentials" + ); + sourceAccountId = await withRetry(() => exportAccountId(credentialsClient, maskAccountId), "exportAccountId"); + } } if (customTags && (useGitHubOIDCProvider() || webIdentityTokenFile)) { warning( @@ -78189,7 +78191,7 @@ async function run() { } while (specialCharacterWorkaround && !verifyKeys(roleCredentials.Credentials)); info(`Authenticated as assumedRoleId ${roleCredentials.AssumedRoleUser?.AssumedRoleId}`); exportCredentials(roleCredentials.Credentials, outputCredentials, outputEnvCredentials); - if ((!process.env.GITHUB_ACTIONS || AccessKeyId) && !awsProfile) { + if ((!process.env.GITHUB_ACTIONS || AccessKeyId) && !awsProfile && outputEnvCredentials) { await withRetry( () => credentialsClient.validateCredentials( roleCredentials.Credentials?.AccessKeyId,