Fix timeout

This commit is contained in:
Colin McDonnell
2025-12-22 12:50:00 -08:00
parent 6d572f3ce8
commit 507efb0c25
2 changed files with 9166 additions and 16205 deletions
+9161 -16199
View File
File diff suppressed because one or more lines are too long
+5 -6
View File
@@ -48,17 +48,16 @@ function isGitHubActionsEnvironment(): boolean {
} }
async function acquireTokenViaOIDC(): Promise<string> { async function acquireTokenViaOIDC(): Promise<string> {
log.debug("» generating OIDC token..."); log.info("» generating OIDC token...");
const oidcToken = await core.getIDToken("pullfrog-api"); const oidcToken = await core.getIDToken("pullfrog-api");
log.debug("» OIDC token generated successfully");
const apiUrl = process.env.API_URL || "https://pullfrog.com"; const apiUrl = process.env.API_URL || "https://pullfrog.com";
log.debug("» exchanging OIDC token for installation token..."); log.info("» exchanging OIDC token for installation token...");
// Add timeout to prevent long waits (5 seconds) // Add timeout to prevent long waits (30 seconds)
const timeoutMs = 5000; const timeoutMs = 30000;
const controller = new AbortController(); const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), timeoutMs); const timeoutId = setTimeout(() => controller.abort(), timeoutMs);
@@ -79,7 +78,7 @@ async function acquireTokenViaOIDC(): Promise<string> {
} }
const tokenData = (await tokenResponse.json()) as InstallationToken; const tokenData = (await tokenResponse.json()) as InstallationToken;
log.debug(`» installation token obtained for ${tokenData.repository || "all repositories"}`); log.info(`» installation token obtained for ${tokenData.repository || "all repositories"}`);
return tokenData.token; return tokenData.token;
} catch (error) { } catch (error) {