Skip to content

Commit

Permalink
Merge pull request #1945 from github/henrymercer/authenticate-api-url
Browse files Browse the repository at this point in the history
 Authenticate when downloading CodeQL Bundle from GHES API
  • Loading branch information
henrymercer committed Oct 12, 2023
2 parents 34f97d7 + 74442e0 commit 82ba90b
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th

## [UNRELEASED]

No user facing changes.
- Provide an authentication token when downloading the CodeQL Bundle from the API of a GitHub Enterprise Server instance. [#1945](https://github.com/github/codeql-action/pull/1945)

## 2.22.2 - 12 Oct 2023

Expand Down
3 changes: 2 additions & 1 deletion lib/setup-codeql.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion lib/setup-codeql.js.map

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion src/setup-codeql.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 82ba90b

Please sign in to comment.