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
+4 -4
View File
@@ -119256,7 +119256,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(
@@ -119465,10 +119465,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) {
@@ -120965,7 +120965,7 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV
}
}
async function getArtifactUploaderClient(logger, ghVariant) {
if (ghVariant === "GHES" /* GHES */) {
if (ghVariant === "GitHub Enterprise Server" /* GHES */) {
logger.info(
"Debug artifacts can be consumed with `actions/download-artifact@v3` because the `v4` version is not yet compatible on GHES."
);
+10 -10
View File
@@ -87417,7 +87417,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"
)) {
@@ -87800,10 +87800,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) {
@@ -89096,7 +89096,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
@@ -89105,7 +89105,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();
@@ -90137,7 +90137,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
@@ -91689,7 +91689,7 @@ async function cleanupAndUploadDatabases(repositoryNwo, codeql, config, apiDetai
logger.debug("In test mode. Skipping database upload.");
return;
}
if (config.gitHubVersion.type !== "GitHub.com" /* DOTCOM */ && config.gitHubVersion.type !== "GHEC-DR" /* GHEC_DR */) {
if (config.gitHubVersion.type !== "GitHub.com" /* DOTCOM */ && config.gitHubVersion.type !== "GitHub Enterprise Cloud with data residency" /* GHEC_DR */) {
logger.debug("Not running against github.com or GHEC-DR. Skipping upload.");
return;
}
@@ -93143,7 +93143,7 @@ function areAllRunsUnique(sarifObjects) {
return true;
}
async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, githubVersion) {
if (githubVersion.type === "GHES" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) {
if (githubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) {
return false;
}
return !areAllRunsUnique(sarifObjects) && !process.env.CODEQL_MERGE_SARIF_DEPRECATION_WARNING;
@@ -93158,7 +93158,7 @@ async function throwIfCombineSarifFilesDisabled(sarifObjects, githubVersion) {
);
}
async function shouldDisableCombineSarifFiles(sarifObjects, githubVersion) {
if (githubVersion.type === "GHES" /* GHES */) {
if (githubVersion.type === "GitHub Enterprise Server" /* GHES */) {
if (satisfiesGHESVersion(githubVersion.version, "<3.18", true)) {
return false;
}
@@ -93173,7 +93173,7 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo
const sarifObjects = sarifFiles.map((sarifFile) => {
return JSON.parse(fs15.readFileSync(sarifFile, "utf8"));
});
const deprecationWarningMessage = gitHubVersion.type === "GHES" /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025";
const deprecationWarningMessage = gitHubVersion.type === "GitHub Enterprise Server" /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025";
const deprecationMoreInformationMessage = "For more information, see https://github.blog/changelog/2024-05-06-code-scanning-will-stop-combining-runs-from-a-single-upload";
if (!areAllRunsProducedByCodeQL(sarifObjects)) {
await throwIfCombineSarifFilesDisabled(sarifObjects, gitHubVersion);
+5 -5
View File
@@ -83034,7 +83034,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(
@@ -83161,7 +83161,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"
)) {
@@ -83374,10 +83374,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) {
@@ -84415,7 +84415,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/trap-caching.ts
+9 -9
View File
@@ -122166,7 +122166,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(
@@ -122675,10 +122675,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) {
@@ -123856,7 +123856,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
@@ -124633,7 +124633,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
@@ -125691,7 +125691,7 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV
}
}
async function getArtifactUploaderClient(logger, ghVariant) {
if (ghVariant === "GHES" /* GHES */) {
if (ghVariant === "GitHub Enterprise Server" /* GHES */) {
logger.info(
"Debug artifacts can be consumed with `actions/download-artifact@v3` because the `v4` version is not yet compatible on GHES."
);
@@ -127165,7 +127165,7 @@ function areAllRunsUnique(sarifObjects) {
return true;
}
async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, githubVersion) {
if (githubVersion.type === "GHES" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) {
if (githubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) {
return false;
}
return !areAllRunsUnique(sarifObjects) && !process.env.CODEQL_MERGE_SARIF_DEPRECATION_WARNING;
@@ -127180,7 +127180,7 @@ async function throwIfCombineSarifFilesDisabled(sarifObjects, githubVersion) {
);
}
async function shouldDisableCombineSarifFiles(sarifObjects, githubVersion) {
if (githubVersion.type === "GHES" /* GHES */) {
if (githubVersion.type === "GitHub Enterprise Server" /* GHES */) {
if (satisfiesGHESVersion(githubVersion.version, "<3.18", true)) {
return false;
}
@@ -127195,7 +127195,7 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo
const sarifObjects = sarifFiles.map((sarifFile) => {
return JSON.parse(fs14.readFileSync(sarifFile, "utf8"));
});
const deprecationWarningMessage = gitHubVersion.type === "GHES" /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025";
const deprecationWarningMessage = gitHubVersion.type === "GitHub Enterprise Server" /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025";
const deprecationMoreInformationMessage = "For more information, see https://github.blog/changelog/2024-05-06-code-scanning-will-stop-combining-runs-from-a-single-upload";
if (!areAllRunsProducedByCodeQL(sarifObjects)) {
await throwIfCombineSarifFilesDisabled(sarifObjects, gitHubVersion);
+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
+4 -4
View File
@@ -83034,7 +83034,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(
@@ -83173,7 +83173,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"
)) {
@@ -83382,10 +83382,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) {
+6 -6
View File
@@ -83091,7 +83091,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(
@@ -83249,7 +83249,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"
)) {
@@ -83499,10 +83499,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) {
@@ -84318,7 +84318,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/init.ts
@@ -85264,7 +85264,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
+4 -4
View File
@@ -119235,7 +119235,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(
@@ -119348,10 +119348,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) {
@@ -119848,7 +119848,7 @@ var glob = __toESM(require_glob3());
// src/debug-artifacts.ts
async function getArtifactUploaderClient(logger, ghVariant) {
if (ghVariant === "GHES" /* GHES */) {
if (ghVariant === "GitHub Enterprise Server" /* GHES */) {
logger.info(
"Debug artifacts can be consumed with `actions/download-artifact@v3` because the `v4` version is not yet compatible on GHES."
);
+6 -6
View File
@@ -86355,10 +86355,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) {
@@ -87977,7 +87977,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
@@ -90031,7 +90031,7 @@ function areAllRunsUnique(sarifObjects) {
return true;
}
async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, githubVersion) {
if (githubVersion.type === "GHES" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) {
if (githubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) {
return false;
}
return !areAllRunsUnique(sarifObjects) && !process.env.CODEQL_MERGE_SARIF_DEPRECATION_WARNING;
@@ -90046,7 +90046,7 @@ async function throwIfCombineSarifFilesDisabled(sarifObjects, githubVersion) {
);
}
async function shouldDisableCombineSarifFiles(sarifObjects, githubVersion) {
if (githubVersion.type === "GHES" /* GHES */) {
if (githubVersion.type === "GitHub Enterprise Server" /* GHES */) {
if (satisfiesGHESVersion(githubVersion.version, "<3.18", true)) {
return false;
}
@@ -90061,7 +90061,7 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo
const sarifObjects = sarifFiles.map((sarifFile) => {
return JSON.parse(fs11.readFileSync(sarifFile, "utf8"));
});
const deprecationWarningMessage = gitHubVersion.type === "GHES" /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025";
const deprecationWarningMessage = gitHubVersion.type === "GitHub Enterprise Server" /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025";
const deprecationMoreInformationMessage = "For more information, see https://github.blog/changelog/2024-05-06-code-scanning-will-stop-combining-runs-from-a-single-upload";
if (!areAllRunsProducedByCodeQL(sarifObjects)) {
await throwIfCombineSarifFilesDisabled(sarifObjects, gitHubVersion);
+4 -4
View File
@@ -119235,7 +119235,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(
@@ -119352,10 +119352,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) {
@@ -119920,7 +119920,7 @@ async function uploadDebugArtifacts(logger, toUpload, rootDir, artifactName, ghV
}
}
async function getArtifactUploaderClient(logger, ghVariant) {
if (ghVariant === "GHES" /* GHES */) {
if (ghVariant === "GitHub Enterprise Server" /* GHES */) {
logger.info(
"Debug artifacts can be consumed with `actions/download-artifact@v3` because the `v4` version is not yet compatible on GHES."
);
+8 -8
View File
@@ -86069,7 +86069,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"
)) {
@@ -86401,10 +86401,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) {
@@ -87268,7 +87268,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/status-report.ts
@@ -88498,7 +88498,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
@@ -90552,7 +90552,7 @@ function areAllRunsUnique(sarifObjects) {
return true;
}
async function shouldShowCombineSarifFilesDeprecationWarning(sarifObjects, githubVersion) {
if (githubVersion.type === "GHES" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) {
if (githubVersion.type === "GitHub Enterprise Server" /* GHES */ && satisfiesGHESVersion(githubVersion.version, "<3.14", true)) {
return false;
}
return !areAllRunsUnique(sarifObjects) && !process.env.CODEQL_MERGE_SARIF_DEPRECATION_WARNING;
@@ -90567,7 +90567,7 @@ async function throwIfCombineSarifFilesDisabled(sarifObjects, githubVersion) {
);
}
async function shouldDisableCombineSarifFiles(sarifObjects, githubVersion) {
if (githubVersion.type === "GHES" /* GHES */) {
if (githubVersion.type === "GitHub Enterprise Server" /* GHES */) {
if (satisfiesGHESVersion(githubVersion.version, "<3.18", true)) {
return false;
}
@@ -90582,7 +90582,7 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo
const sarifObjects = sarifFiles.map((sarifFile) => {
return JSON.parse(fs12.readFileSync(sarifFile, "utf8"));
});
const deprecationWarningMessage = gitHubVersion.type === "GHES" /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025";
const deprecationWarningMessage = gitHubVersion.type === "GitHub Enterprise Server" /* GHES */ ? "and will be removed in GitHub Enterprise Server 3.18" : "and will be removed in July 2025";
const deprecationMoreInformationMessage = "For more information, see https://github.blog/changelog/2024-05-06-code-scanning-will-stop-combining-runs-from-a-single-upload";
if (!areAllRunsProducedByCodeQL(sarifObjects)) {
await throwIfCombineSarifFilesDisabled(sarifObjects, gitHubVersion);