diff --git a/lib/entry-points.js b/lib/entry-points.js index ebe7f9d17..d9047f677 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -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: { diff --git a/src/api-client.ts b/src/api-client.ts index 31169480a..4d0a99920 100644 --- a/src/api-client.ts +++ b/src/api-client.ts @@ -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: {