diff --git a/src/diff-informed-analysis-utils.ts b/src/diff-informed-analysis-utils.ts index 0433ae0bb..7a23b3a29 100644 --- a/src/diff-informed-analysis-utils.ts +++ b/src/diff-informed-analysis-utils.ts @@ -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(