mirror of
https://github.com/github/codeql-action.git
synced 2026-05-07 14:20:19 +00:00
Use consistent user agent for toolcache download and other API usage
This commit is contained in:
Generated
+2
-2
@@ -258,6 +258,7 @@ async function setupCodeQL(codeqlURL, apiDetails, tempDir, variant, logger, chec
|
||||
const parsedQueryString = query_string_1.default.parse(parsedCodeQLURL.search);
|
||||
const headers = {
|
||||
accept: "application/octet-stream",
|
||||
"User-Agent": util.getUserAgent(),
|
||||
};
|
||||
// We only want to provide an authorization header if we are downloading
|
||||
// from the same GitHub instance the Action is running on.
|
||||
@@ -273,8 +274,7 @@ async function setupCodeQL(codeqlURL, apiDetails, tempDir, variant, logger, chec
|
||||
}
|
||||
logger.info(`Downloading CodeQL tools from ${codeqlURL}. This may take a while.`);
|
||||
const dest = path.join(tempDir, (0, uuid_1.v4)());
|
||||
const finalHeaders = Object.assign({ "User-Agent": "CodeQL Action" }, headers);
|
||||
const codeqlPath = await toolcache.downloadTool(codeqlURL, dest, undefined, finalHeaders);
|
||||
const codeqlPath = await toolcache.downloadTool(codeqlURL, dest, undefined, headers);
|
||||
logger.debug(`CodeQL bundle download to ${codeqlPath} complete.`);
|
||||
const codeqlExtracted = await toolcache.extractTar(codeqlPath);
|
||||
codeqlFolder = await toolcache.cacheDir(codeqlExtracted, "CodeQL", codeqlURLSemVer);
|
||||
|
||||
Reference in New Issue
Block a user