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
5
lib/upload-lib.js
generated
5
lib/upload-lib.js
generated
|
|
@ -44,6 +44,7 @@ const feature_flags_1 = require("./feature-flags");
|
|||
const fingerprints = __importStar(require("./fingerprints"));
|
||||
const init_1 = require("./init");
|
||||
const repository_1 = require("./repository");
|
||||
const tools_features_1 = require("./tools-features");
|
||||
const util = __importStar(require("./util"));
|
||||
const util_1 = require("./util");
|
||||
const GENERIC_403_MSG = "The repo on which this action is running has not opted-in to CodeQL code scanning.";
|
||||
|
|
@ -110,6 +111,10 @@ async function combineSarifFilesUsingCLI(sarifFiles, gitHubVersion, features, lo
|
|||
apiDetails, tempDir, gitHubVersion.type, codeQLDefaultVersionInfo, logger);
|
||||
codeQL = initCodeQLResult.codeql;
|
||||
}
|
||||
if (!(await codeQL.supportsFeature(tools_features_1.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