mirror of
https://github.com/github/codeql-action.git
synced 2025-12-30 03:00:13 +08:00
Diff-informed analysis: disable for GHES below 3.19
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user