Use full names for GitHub variants

This commit is contained in:
Henry Mercer
2025-12-16 13:23:24 +00:00
parent da501245d4
commit a2ee53c0d3
13 changed files with 85 additions and 70 deletions
+8 -8
View File
@@ -84534,7 +84534,7 @@ function parseGitHubUrl(inputUrl) {
var CODEQL_ACTION_WARNED_ABOUT_VERSION_ENV_VAR = "CODEQL_ACTION_WARNED_ABOUT_VERSION";
var hasBeenWarnedAboutVersion = false;
function checkGitHubVersionInRange(version, logger) {
if (hasBeenWarnedAboutVersion || version.type !== "GHES" /* GHES */) {
if (hasBeenWarnedAboutVersion || version.type !== "GitHub Enterprise Server" /* GHES */) {
return;
}
const disallowedAPIVersionReason = apiVersionInRange(
@@ -84738,7 +84738,7 @@ async function checkDiskUsage(logger) {
function checkActionVersion(version, githubVersion) {
if (!semver.satisfies(version, ">=4") && // do not log error if the customer is already running v4
!process.env["CODEQL_ACTION_DID_LOG_VERSION_DEPRECATION" /* LOG_VERSION_DEPRECATION */]) {
if (githubVersion.type === "GitHub.com" /* DOTCOM */ || githubVersion.type === "GHEC-DR" /* GHEC_DR */ || githubVersion.type === "GHES" /* GHES */ && semver.satisfies(
if (githubVersion.type === "GitHub.com" /* DOTCOM */ || githubVersion.type === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */ || githubVersion.type === "GitHub Enterprise Server" /* GHES */ && semver.satisfies(
semver.coerce(githubVersion.version) ?? "0.0.0",
">=3.20"
)) {
@@ -85125,10 +85125,10 @@ async function getGitHubVersionFromApi(apiClient, apiDetails) {
return { type: "GitHub.com" /* DOTCOM */ };
}
if (response.headers[GITHUB_ENTERPRISE_VERSION_HEADER] === "ghe.com") {
return { type: "GHEC-DR" /* GHEC_DR */ };
return { type: "GitHub Enterprise Cloud with data residency" /* GHEC_DR */ };
}
const version = response.headers[GITHUB_ENTERPRISE_VERSION_HEADER];
return { type: "GHES" /* GHES */, version };
return { type: "GitHub Enterprise Server" /* GHES */, version };
}
async function getGitHubVersion() {
if (cachedGitHubVersion === void 0) {
@@ -85350,7 +85350,7 @@ var RepositoryPropertyName = /* @__PURE__ */ ((RepositoryPropertyName2) => {
return RepositoryPropertyName2;
})(RepositoryPropertyName || {});
async function loadPropertiesFromApi(gitHubVersion, logger, repositoryNwo) {
if (gitHubVersion.type === "GHES" /* GHES */) {
if (gitHubVersion.type === "GitHub Enterprise Server" /* GHES */) {
return {};
}
try {
@@ -86510,7 +86510,7 @@ var GitHubFeatureFlags = class {
}
};
function supportsFeatureFlags(githubVariant) {
return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GHEC-DR" /* GHEC_DR */;
return githubVariant === "GitHub.com" /* DOTCOM */ || githubVariant === "GitHub Enterprise Cloud with data residency" /* GHEC_DR */;
}
// src/diff-informed-analysis-utils.ts
@@ -86522,7 +86522,7 @@ async function getDiffInformedAnalysisBranches(codeql, features, logger) {
return void 0;
}
const gitHubVersion = await getGitHubVersion();
if (gitHubVersion.type === "GHES" /* GHES */ && satisfiesGHESVersion(gitHubVersion.version, "<3.19", true)) {
if (gitHubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(gitHubVersion.version, "<3.19", true)) {
return void 0;
}
const branches = getPullRequestBranches();
@@ -88385,7 +88385,7 @@ async function getCodeQLSource(toolsInput, defaultCliVersion, apiDetails, varian
toolsVersion: cliVersion2 ?? humanReadableVersion
};
}
if (variant === "GHES" /* GHES */ && !forceShippedTools && !toolsInput) {
if (variant === "GitHub Enterprise Server" /* GHES */ && !forceShippedTools && !toolsInput) {
const result = await findOverridingToolsInCache(
humanReadableVersion,
logger