Provide token when downloading from GHES API

This commit is contained in:
Henry Mercer 2023-10-12 17:26:42 +01:00
parent b584cf8321
commit bd32fab74f
3 changed files with 7 additions and 3 deletions

View file

@ -546,7 +546,10 @@ export async function downloadCodeQL(
let authorization: string | undefined = undefined;
if (searchParams.has("token")) {
logger.debug("CodeQL tools URL contains an authorization token.");
} else if (codeqlURL.startsWith(`${apiDetails.url}/`)) {
} else if (
codeqlURL.startsWith(`${apiDetails.url}/`) ||
(apiDetails.apiURL && codeqlURL.startsWith(`${apiDetails.apiURL}/`))
) {
logger.debug("Providing an authorization token to download CodeQL tools.");
authorization = `token ${apiDetails.auth}`;
} else {