Skip to content

Commit a42a10c

Browse files
Add retries for getIDToken (#502)
Closes #496
1 parent 5d5dceb commit a42a10c

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 {
@@ -131,7 +132,12 @@ export async function run(logger: Logger) {
131132
throw new Error(oidcWarning);
132133
}
133134

134-
const oidcToken = await getIDToken(oidcTokenAudience);
135+
const oidcToken = await withRetries(
136+
async (): Promise<string> => {
137+
return await getIDToken(oidcTokenAudience);
138+
},
139+
{ retries: 3 },
140+
)();
135141
client = new WorkloadIdentityFederationClient({
136142
logger: logger,
137143
universe: universe,

0 commit comments

Comments
 (0)