Move some definitions out of util.ts into a new github.ts module

This commit is contained in:
Michael B. Gale
2026-10-13 14:42:12 +01:00
parent 63387d169f
commit 0b0ac95647
9 changed files with 184 additions and 158 deletions

View File

@@ -36,6 +36,7 @@ import {
Feature,
FeatureEnablement,
} from "./feature-flags";
import { GITHUB_DOTCOM_URL } from "./github";
import { BuiltInLanguage } from "./languages";
import { Logger } from "./logging";
import { getCodeQlVersionsForOverlayBaseDatabases } from "./overlay/caching";
@@ -100,7 +101,7 @@ async function getCodeQLBundleDownloadURL(
// This GitHub instance, and the canonical Action.
[apiDetails.url, CODEQL_DEFAULT_ACTION_REPOSITORY],
// GitHub.com, and the canonical Action.
[util.GITHUB_DOTCOM_URL, CODEQL_DEFAULT_ACTION_REPOSITORY],
[GITHUB_DOTCOM_URL, CODEQL_DEFAULT_ACTION_REPOSITORY],
];
// We now filter out any duplicates.
// Duplicates will happen either because the GitHub instance is GitHub.com, or because the Action is not a fork.
@@ -113,7 +114,7 @@ async function getCodeQLBundleDownloadURL(
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 (
apiURL === util.GITHUB_DOTCOM_URL &&
apiURL === GITHUB_DOTCOM_URL &&
repository === CODEQL_DEFAULT_ACTION_REPOSITORY
) {
break;