mirror of
https://github.com/github/codeql-action.git
synced 2026-10-30 01:27:22 +00:00
Add getDefaultDotComDownloadURL
This commit is contained in:
5
lib/entry-points.js
generated
5
lib/entry-points.js
generated
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user