Skip to content

Commit c1ee334

Browse files
authored
Add retries for getIDToken (#502)
Closes #496
1 parent 140bb51 commit c1ee334

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/main.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ import {
3131
parseBoolean,
3232
parseDuration,
3333
pinnedToHeadWarning,
34+
withRetries,
3435
} from '@google-github-actions/actions-utils';
3536

3637
import {
@@ -110,7 +111,12 @@ export async function run(logger: Logger) {
110111
throw new Error(oidcWarning);
111112
}
112113

113-
const oidcToken = await getIDToken(oidcTokenAudience);
114+
const oidcToken = await withRetries(
115+
async (): Promise<string> => {
116+
return await getIDToken(oidcTokenAudience);
117+
},
118+
{ retries: 3 },
119+
)();
114120
client = new WorkloadIdentityFederationClient({
115121
logger: logger,
116122
universe: universe,

0 commit comments

Comments
 (0)