diff --git a/lib/entry-points.js b/lib/entry-points.js index ede4701fd..aeb16a4d2 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -178502,7 +178502,7 @@ async function recordClearCleanupSizes(codeql, config, reports, logger2) { } } async function uploadBundledDatabase(repositoryNwo, language, commitOid, bundledDb, bundledDbSize, apiDetails) { - const client = getApiClient(); + const client = getApiClient(getEnv(), apiDetails); const uploadsUrl = new URL(parseGitHubUrl(apiDetails.url)); uploadsUrl.hostname = `uploads.${uploadsUrl.hostname}`; let uploadsBaseUrl = uploadsUrl.toString(); diff --git a/src/database-upload.ts b/src/database-upload.ts index 07b1626b4..75caa46ca 100644 --- a/src/database-upload.ts +++ b/src/database-upload.ts @@ -267,7 +267,10 @@ async function uploadBundledDatabase( bundledDbSize: number, apiDetails: GitHubApiDetails, ): Promise { - const client = getApiClient(); + // Ensure that the `apiDetails` that `getApiClient` uses match the ones we were given here, + // because we use `apiDetails.auth` below which must be used with the same instance that + // `apiDetails` refers to. + const client = getApiClient(util.getEnv(), apiDetails); const uploadsUrl = new URL(parseGitHubUrl(apiDetails.url)); uploadsUrl.hostname = `uploads.${uploadsUrl.hostname}`;