From 5aa103d050a3985a691d3cb0c4d2f1055d523cd1 Mon Sep 17 00:00:00 2001 From: "Michael B. Gale" Date: Mon, 12 Oct 2026 15:52:22 +0100 Subject: [PATCH] Add `InstanceURL` and use in `DownloadSource` --- src/setup/repository.ts | 4 ++-- src/util.ts | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/setup/repository.ts b/src/setup/repository.ts index 2e5387297..959ca4b8d 100644 --- a/src/setup/repository.ts +++ b/src/setup/repository.ts @@ -3,7 +3,7 @@ import { isRunningLocalAction } from "../actions-util"; import * as api from "../api-client"; import { ActionsEnvVars } from "../environment"; import { isRepositoryNwoStr, type RepositoryNwoStr } from "../repository"; -import { GITHUB_DOTCOM_URL } from "../util"; +import { GITHUB_DOTCOM_URL, type InstanceURL } from "../util"; /** The NWO of the standard CodeQL Action repository. */ export const CODEQL_DEFAULT_ACTION_REPOSITORY = "github/codeql-action"; @@ -43,7 +43,7 @@ export function getCodeQLActionRepository( } /**A download source is a pair of strings. */ -export type DownloadSource = [string, RepositoryNwoStr]; +export type DownloadSource = [InstanceURL, RepositoryNwoStr]; /** GitHub.com, and the canonical Action. */ export const DEFAULT_DOWNLOAD_SOURCE: DownloadSource = [ diff --git a/src/util.ts b/src/util.ts index 3a42d8b94..0b10e0f04 100644 --- a/src/util.ts +++ b/src/util.ts @@ -46,10 +46,13 @@ const BASE_DATABASE_OIDS_FILE_NAME = "base-database-oids.json"; */ const BROKEN_VERSIONS = ["0.0.0-20211207"]; +/** A string representing a GitHub instance. */ +export type InstanceURL = string; + /** * The URL for github.com. */ -export const GITHUB_DOTCOM_URL = "https://github.com"; +export const GITHUB_DOTCOM_URL: InstanceURL = "https://github.com"; /** * Default name of the debugging artifact.