Diff-informed analysis: disable for GHES below 3.19

This commit is contained in:
Chuan-kai Lin
2025-07-17 06:10:14 -07:00
parent aefb854fe5
commit 614b64c6ec

View File

@@ -3,9 +3,11 @@ import * as path from "path";
import * as actionsUtil from "./actions-util";
import type { PullRequestBranches } from "./actions-util";
import { getGitHubVersion } from "./api-client";
import type { CodeQL } from "./codeql";
import { Feature, FeatureEnablement } from "./feature-flags";
import { Logger } from "./logging";
import { GitHubVariant, satisfiesGHESVersion } from "./util";
/**
* Check if the action should perform diff-informed analysis.
@@ -37,6 +39,14 @@ export async function getDiffInformedAnalysisBranches(
return undefined;
}
const gitHubVersion = await getGitHubVersion();
if (
gitHubVersion.type === GitHubVariant.GHES &&
satisfiesGHESVersion(gitHubVersion.version, "<3.19", true)
) {
return undefined;
}
const branches = actionsUtil.getPullRequestBranches();
if (!branches) {
logger.info(