chore: Update dist

This commit is contained in:
GitHub Actions
2026-05-11 17:00:57 +00:00
parent 540d0c13ae
commit 958a80fc34
Generated Vendored
+31 -25
View File
@@ -71149,7 +71149,7 @@ function verifyKeys(creds) {
} }
return true; return true;
} }
async function retryAndBackoff(fn, isRetryable, maxRetries = 12, retries = 0, base = 50) { async function retryAndBackoff(fn, isRetryable, maxRetries = 12, retries = 0, base = 50, label) {
try { try {
return await fn(); return await fn();
} catch (err) { } catch (err) {
@@ -71159,15 +71159,16 @@ async function retryAndBackoff(fn, isRetryable, maxRetries = 12, retries = 0, ba
} }
const delay = Math.random() * (2 ** retries * base); const delay = Math.random() * (2 ** retries * base);
const nextRetry = retries + 1; const nextRetry = retries + 1;
debug( const opName = label ? ` ${label}` : "";
`retryAndBackoff: attempt ${nextRetry} of ${maxRetries} failed: ${errorMessage(err)}. Retrying after ${Math.floor(delay)}ms.` info(
`Retry${opName}: attempt ${nextRetry} of ${maxRetries} failed: ${errorMessage(err)}. Retrying after ${Math.floor(delay)}ms.`
); );
await sleep(delay); await sleep(delay);
if (nextRetry >= maxRetries) { if (nextRetry >= maxRetries) {
debug("retryAndBackoff: reached max retries; giving up."); info(`Retry${opName}: reached max retries (${maxRetries}); giving up.`);
throw err; throw err;
} }
return await retryAndBackoff(fn, isRetryable, maxRetries, nextRetry, base); return await retryAndBackoff(fn, isRetryable, maxRetries, nextRetry, base, label);
} }
} }
function errorMessage(error3) { function errorMessage(error3) {
@@ -72861,6 +72862,7 @@ async function run() {
} else if (maxRetries < 1) { } else if (maxRetries < 1) {
maxRetries = 1; maxRetries = 1;
} }
const withRetry = (fn, label) => retryAndBackoff(fn, !disableRetry, maxRetries, 0, 50, label);
const useGitHubOIDCProvider = () => { const useGitHubOIDCProvider = () => {
if (forceSkipOidc) return false; if (forceSkipOidc) return false;
if (!!roleToAssume && !webIdentityTokenFile && !AccessKeyId && !process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN && !roleChaining) { if (!!roleToAssume && !webIdentityTokenFile && !AccessKeyId && !process.env.ACTIONS_ID_TOKEN_REQUEST_TOKEN && !roleChaining) {
@@ -72898,13 +72900,9 @@ async function run() {
} }
if (useGitHubOIDCProvider()) { if (useGitHubOIDCProvider()) {
try { try {
webIdentityToken = await retryAndBackoff( webIdentityToken = await withRetry(async () => {
async () => {
return getIDToken(audience); return getIDToken(audience);
}, }, "getIDToken");
!disableRetry,
maxRetries
);
} catch (error3) { } catch (error3) {
throw new Error(`getIDToken call failed: ${errorMessage(error3)}`); throw new Error(`getIDToken call failed: ${errorMessage(error3)}`);
} }
@@ -72917,12 +72915,18 @@ async function run() {
writeProfileFiles(awsProfile, { AccessKeyId, SecretAccessKey, SessionToken }, region, overwriteAwsProfile); writeProfileFiles(awsProfile, { AccessKeyId, SecretAccessKey, SessionToken }, region, overwriteAwsProfile);
} }
} else if (!webIdentityTokenFile && !roleChaining) { } else if (!webIdentityTokenFile && !roleChaining) {
await credentialsClient.validateCredentials(void 0, roleChaining, expectedAccountIds); await withRetry(
sourceAccountId = await exportAccountId(credentialsClient, maskAccountId); () => credentialsClient.validateCredentials(void 0, roleChaining, expectedAccountIds),
"validateCredentials"
);
sourceAccountId = await withRetry(() => exportAccountId(credentialsClient, maskAccountId), "exportAccountId");
} }
if (AccessKeyId || roleChaining) { if (AccessKeyId || roleChaining) {
await credentialsClient.validateCredentials(AccessKeyId, roleChaining, expectedAccountIds); await withRetry(
sourceAccountId = await exportAccountId(credentialsClient, maskAccountId); () => credentialsClient.validateCredentials(AccessKeyId, roleChaining, expectedAccountIds),
"validateCredentials"
);
sourceAccountId = await withRetry(() => exportAccountId(credentialsClient, maskAccountId), "exportAccountId");
} }
if (customTags && (useGitHubOIDCProvider() || webIdentityTokenFile)) { if (customTags && (useGitHubOIDCProvider() || webIdentityTokenFile)) {
warning( warning(
@@ -72932,8 +72936,7 @@ async function run() {
if (roleToAssume) { if (roleToAssume) {
let roleCredentials; let roleCredentials;
do { do {
roleCredentials = await retryAndBackoff( roleCredentials = await withRetry(async () => {
async () => {
return assumeRole({ return assumeRole({
credentialsClient, credentialsClient,
sourceAccountId, sourceAccountId,
@@ -72949,22 +72952,22 @@ async function run() {
managedSessionPolicies, managedSessionPolicies,
customTags customTags
}); });
}, }, "AssumeRole");
!disableRetry,
maxRetries
);
} while (specialCharacterWorkaround && !verifyKeys(roleCredentials.Credentials)); } while (specialCharacterWorkaround && !verifyKeys(roleCredentials.Credentials));
info(`Authenticated as assumedRoleId ${roleCredentials.AssumedRoleUser?.AssumedRoleId}`); info(`Authenticated as assumedRoleId ${roleCredentials.AssumedRoleUser?.AssumedRoleId}`);
exportCredentials(roleCredentials.Credentials, outputCredentials, outputEnvCredentials); exportCredentials(roleCredentials.Credentials, outputCredentials, outputEnvCredentials);
if ((!process.env.GITHUB_ACTIONS || AccessKeyId) && !awsProfile) { if ((!process.env.GITHUB_ACTIONS || AccessKeyId) && !awsProfile) {
await credentialsClient.validateCredentials( await withRetry(
() => credentialsClient.validateCredentials(
roleCredentials.Credentials?.AccessKeyId, roleCredentials.Credentials?.AccessKeyId,
roleChaining, roleChaining,
expectedAccountIds expectedAccountIds
),
"validateCredentials"
); );
} }
if (outputEnvCredentials) { if (outputEnvCredentials) {
await exportAccountId(credentialsClient, maskAccountId); await withRetry(() => exportAccountId(credentialsClient, maskAccountId), "exportAccountId");
} }
if (awsProfile) { if (awsProfile) {
if (!roleCredentials.Credentials) { if (!roleCredentials.Credentials) {
@@ -72972,10 +72975,13 @@ async function run() {
} }
if (AccessKeyId || !process.env.GITHUB_ACTIONS) { if (AccessKeyId || !process.env.GITHUB_ACTIONS) {
writeProfileFiles(awsProfile, roleCredentials.Credentials, region, true); writeProfileFiles(awsProfile, roleCredentials.Credentials, region, true);
await credentialsClient.validateCredentials( await withRetry(
roleCredentials.Credentials.AccessKeyId, () => credentialsClient.validateCredentials(
roleCredentials.Credentials?.AccessKeyId,
roleChaining, roleChaining,
expectedAccountIds expectedAccountIds
),
"validateCredentials"
); );
} else { } else {
writeProfileFiles(awsProfile, roleCredentials.Credentials, region, overwriteAwsProfile); writeProfileFiles(awsProfile, roleCredentials.Credentials, region, overwriteAwsProfile);