Skip to content

Commit ca3b5e1

Browse files
committed
Diff-informed analysis: disable for GHES below 3.19
1 parent ed78869 commit ca3b5e1

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/diff-informed-analysis-utils.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import * as fs from "fs";
22
import * as path from "path";
33

4+
import * as semver from "semver";
5+
46
import * as actionsUtil from "./actions-util";
57
import type { PullRequestBranches } from "./actions-util";
8+
import { getGitHubVersion } from "./api-client";
69
import type { CodeQL } from "./codeql";
710
import { Feature, FeatureEnablement } from "./feature-flags";
811
import { Logger } from "./logging";
12+
import { GitHubVariant, parseGhesVersion } from "./util";
913

1014
/**
1115
* Check if the action should perform diff-informed analysis.
@@ -37,6 +41,14 @@ export async function getDiffInformedAnalysisBranches(
3741
return undefined;
3842
}
3943

44+
const gitHubVersion = await getGitHubVersion();
45+
if (
46+
gitHubVersion.type === GitHubVariant.GHES &&
47+
semver.lt(parseGhesVersion(gitHubVersion.version), "3.19.0")
48+
) {
49+
return undefined;
50+
}
51+
4052
const branches = actionsUtil.getPullRequestBranches();
4153
if (!branches) {
4254
logger.info(

0 commit comments

Comments
 (0)