Add getDefaultDotComDownloadURL

This commit is contained in:
Michael B. Gale
2026-10-06 16:30:20 +01:00
parent a4f9f6fc12
commit de99f0ee4b
2 changed files with 13 additions and 2 deletions

5
lib/entry-points.js generated
View File

@@ -175616,6 +175616,9 @@ var DEFAULT_DOWNLOAD_SOURCE = [
var isSameDownloadSource = ([srcUrl, srcRepo], [otherUrl, otherRepo]) => {
return srcUrl === otherUrl && srcRepo === otherRepo;
};
function getDefaultDotComDownloadURL(tagName, assetName) {
return `https://github.com/${CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${tagName}/${assetName}`;
}
async function getCodeQLAssetDownloadURL(action, apiDetails, tagName, assetName, assetKind = "CodeQL bundle") {
const codeQLActionRepository = getCodeQLActionRepository(action);
const potentialDownloadSources = [
@@ -175656,7 +175659,7 @@ async function getCodeQLAssetDownloadURL(action, apiDetails, tagName, assetName,
);
}
}
return `https://github.com/${CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${tagName}/${assetName}`;
return getDefaultDotComDownloadURL(tagName, assetName);
}
// src/tar.ts

View File

@@ -51,6 +51,14 @@ const isSameDownloadSource = (
/** A download URL is represented as a string. */
export type DownloadURL = string;
/** Gets the default GitHub.com download URL for `assetName` in a release tagged `tagName`. */
export function getDefaultDotComDownloadURL(
tagName: string,
assetName: string,
): DownloadURL {
return `https://github.com/${CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${tagName}/${assetName}`;
}
/** Enumerates log-friendly descriptions of different kinds of assets we might look for in releases. */
export type ReleaseAssetKind = "CodeQL bundle" | "private registry proxy";
@@ -128,5 +136,5 @@ export async function getCodeQLAssetDownloadURL(
}
}
return `https://github.com/${CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${tagName}/${assetName}`;
return getDefaultDotComDownloadURL(tagName, assetName);
}