mirror of
https://github.com/github/codeql-action.git
synced 2026-05-07 22:30:44 +00:00
Assume small bundles are available in the official repo
This commit is contained in:
Generated
+3
-4
@@ -67,11 +67,10 @@ async function getCodeQLBundleDownloadURL(bundleNames, githubAuth, githubUrl, mo
|
||||
const uniqueDownloadSources = potentialDownloadSources.filter((url, index, self) => index === self.indexOf(url));
|
||||
for (const downloadSource of uniqueDownloadSources) {
|
||||
const [apiURL, repository] = downloadSource;
|
||||
// If we've reached the final case, short-circuit the API check since we know the bundle exists and is public.
|
||||
// If we've reached the final case, short-circuit the API check since we know the bundles exist and are public.
|
||||
if (apiURL === util.GITHUB_DOTCOM_URL &&
|
||||
repository === CODEQL_DEFAULT_ACTION_REPOSITORY &&
|
||||
bundleNames[0] === CODEQL_BUNDLE_NAME) {
|
||||
break;
|
||||
repository === CODEQL_DEFAULT_ACTION_REPOSITORY) {
|
||||
return `https://github.com/${CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${CODEQL_BUNDLE_VERSION}/${bundleNames[0]}`;
|
||||
}
|
||||
const [repositoryOwner, repositoryName] = repository.split("/");
|
||||
try {
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
Generated
+2
@@ -55,6 +55,8 @@ ava_1.default("download and populate codeql bundle cache", async (t) => {
|
||||
}
|
||||
}
|
||||
const cachedVersions = toolcache.findAllVersions("CodeQL");
|
||||
// We should now have 4 cached versions: e.g.,
|
||||
// 20200601, 20200601-linux64-cpp, 20200610, 20200610-linux64-cpp
|
||||
t.is(cachedVersions.length, 4);
|
||||
});
|
||||
});
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -69,6 +69,8 @@ test("download and populate codeql bundle cache", async (t) => {
|
||||
}
|
||||
|
||||
const cachedVersions = toolcache.findAllVersions("CodeQL");
|
||||
// We should now have 4 cached versions: e.g.,
|
||||
// 20200601, 20200601-linux64-cpp, 20200610, 20200610-linux64-cpp
|
||||
t.is(cachedVersions.length, 4);
|
||||
});
|
||||
});
|
||||
|
||||
+3
-4
@@ -164,13 +164,12 @@ export async function getCodeQLBundleDownloadURL(
|
||||
);
|
||||
for (const downloadSource of uniqueDownloadSources) {
|
||||
const [apiURL, repository] = downloadSource;
|
||||
// If we've reached the final case, short-circuit the API check since we know the bundle exists and is public.
|
||||
// If we've reached the final case, short-circuit the API check since we know the bundles exist and are public.
|
||||
if (
|
||||
apiURL === util.GITHUB_DOTCOM_URL &&
|
||||
repository === CODEQL_DEFAULT_ACTION_REPOSITORY &&
|
||||
bundleNames[0] === CODEQL_BUNDLE_NAME
|
||||
repository === CODEQL_DEFAULT_ACTION_REPOSITORY
|
||||
) {
|
||||
break;
|
||||
return `https://github.com/${CODEQL_DEFAULT_ACTION_REPOSITORY}/releases/download/${CODEQL_BUNDLE_VERSION}/${bundleNames[0]}`;
|
||||
}
|
||||
const [repositoryOwner, repositoryName] = repository.split("/");
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user