Merge pull request #1945 from github/henrymercer/authenticate-api-url

Authenticate when downloading CodeQL Bundle from GHES API
This commit is contained in:
Henry Mercer 2023-10-12 19:02:05 +01:00 committed by GitHub
commit 82ba90b1d9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 4 deletions

3
lib/setup-codeql.js generated
View file

@ -411,7 +411,8 @@ async function downloadCodeQL(codeqlURL, maybeBundleVersion, maybeCliVersion, ap
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}`;
}

File diff suppressed because one or more lines are too long