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

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);
}