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

View file

@ -82,6 +82,7 @@ export type ToolsDownloadStatusReport = {
export async function downloadAndExtract(
codeqlURL: string,
compressionMethod: tar.CompressionMethod,
dest: string,
authorization: string | undefined,
headers: OutgoingHttpHeaders,
@ -92,8 +93,6 @@ export async function downloadAndExtract(
`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.`);