Use supportsFeature check for merging SARIF files
This commit is contained in:
parent
2bbafcdd7f
commit
e20c273295
9 changed files with 27 additions and 9 deletions
|
|
@ -19,13 +19,14 @@ import * as fingerprints from "./fingerprints";
|
|||
import { initCodeQL } from "./init";
|
||||
import { Logger } from "./logging";
|
||||
import { parseRepositoryNwo, RepositoryNwo } from "./repository";
|
||||
import { ToolsFeature } from "./tools-features";
|
||||
import * as util from "./util";
|
||||
import {
|
||||
SarifFile,
|
||||
ConfigurationError,
|
||||
wrapError,
|
||||
getRequiredEnvParam,
|
||||
GitHubVersion,
|
||||
SarifFile,
|
||||
wrapError,
|
||||
} from "./util";
|
||||
|
||||
const GENERIC_403_MSG =
|
||||
|
|
@ -134,6 +135,18 @@ async function combineSarifFilesUsingCLI(
|
|||
codeQL = initCodeQLResult.codeql;
|
||||
}
|
||||
|
||||
if (
|
||||
!(await codeQL.supportsFeature(
|
||||
ToolsFeature.SarifMergeRunsFromEqualCategory,
|
||||
))
|
||||
) {
|
||||
logger.warning(
|
||||
"The CodeQL CLI does not support merging SARIF files. Merging files in the action.",
|
||||
);
|
||||
|
||||
return combineSarifFiles(sarifFiles);
|
||||
}
|
||||
|
||||
const baseTempDir = path.resolve(tempDir, "combined-sarif");
|
||||
fs.mkdirSync(baseTempDir, { recursive: true });
|
||||
const outputDirectory = fs.mkdtempSync(path.resolve(baseTempDir, "output-"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue