Pass apiDetails to getApiClient in uploadBundledDatabase

This commit is contained in:
Michael B. Gale
2026-10-14 11:19:56 +01:00
parent a08b587b61
commit f6e8dce502
2 changed files with 5 additions and 2 deletions

2
lib/entry-points.js generated
View File

@@ -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();

View File

@@ -267,7 +267,10 @@ async function uploadBundledDatabase(
bundledDbSize: number,
apiDetails: GitHubApiDetails,
): Promise<number> {
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}`;