From de99f0ee4b789bac85c60c23cf5617af3a93e08f Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Tue, 6 Oct 2026 16:30:20 +0100 Subject: [PATCH] Add `getDefaultDotComDownloadURL` --- lib/entry-points.js | 5 ++++- src/setup/repository.ts | 10 +++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/lib/entry-points.js b/lib/entry-points.js index 71b6915a9..49d38c393 100644 --- a/lib/entry-points.js +++ b/lib/entry-points.js @@ -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 diff --git a/src/setup/repository.ts b/src/setup/repository.ts index 4101be677..3d760858e 100644 --- a/src/setup/repository.ts +++ b/src/setup/repository.ts @@ -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); }