Fix assumption that download URLs contain file extension

This is not the case when downloading the bundle from a GitHub Release synced to GHES with the CodeQL Action sync tool.
This commit is contained in:
Henry Mercer 2025-01-22 12:25:58 +00:00
parent f89b8a7d52
commit d23f49f56f
9 changed files with 139 additions and 47 deletions

3
lib/tools-download.js generated
View file

@ -73,9 +73,8 @@ function makeStreamedToolsDownloadDurations(combinedDurationMs) {
streamExtraction: true,
};
}
async function downloadAndExtract(codeqlURL, dest, authorization, headers, tarVersion, logger) {
async function downloadAndExtract(codeqlURL, compressionMethod, dest, authorization, headers, tarVersion, logger) {
logger.info(`Downloading CodeQL tools from ${codeqlURL} . This may take a while.`);
const compressionMethod = tar.inferCompressionMethod(codeqlURL);
try {
if (compressionMethod === "zstd" && process.platform === "linux") {
logger.info(`Streaming the extraction of the CodeQL bundle.`);