Guard against blank auth value

This shouldn't be possible, but was previously handled by the library
This commit is contained in:
Michael B. Gale
2026-10-13 18:05:49 +01:00
parent f09e27bdf4
commit ccac407b4e
2 changed files with 3 additions and 2 deletions

2
lib/entry-points.js generated
View File

@@ -170762,7 +170762,7 @@ function createApiClientWithDetails(apiDetails, { allowExternal = false, proxy =
const retryingOctokit = githubUtils.GitHub.plugin(retry);
const requestOptions = makeProxyRequestOptions(proxy);
const opts = {
auth: auth2 !== void 0 ? `token ${auth2}` : void 0,
auth: auth2 !== void 0 && auth2.trim() !== "" ? `token ${auth2}` : void 0,
baseUrl: apiDetails.apiURL,
userAgent: `CodeQL-Action/${getActionVersion()}`,
log: {

View File

@@ -138,7 +138,8 @@ function createApiClientWithDetails(
const requestOptions = makeProxyRequestOptions(proxy);
const opts: OctokitOptions = {
auth: auth !== undefined ? `token ${auth}` : undefined,
auth:
auth !== undefined && auth.trim() !== "" ? `token ${auth}` : undefined,
baseUrl: apiDetails.apiURL,
userAgent: `CodeQL-Action/${getActionVersion()}`,
log: {