mirror of
https://github.com/github/codeql-action.git
synced 2025-12-24 08:10:06 +08:00
Unconditionally disable combining SARIF files for GHES 3.18
This commit is contained in:
19
lib/upload-lib.js
generated
19
lib/upload-lib.js
generated
@@ -158,16 +158,25 @@ async function throwIfCombineSarifFilesDisabled(sarifObjects, features, githubVe
|
||||
}
|
||||
// Checks whether combining SARIF files should be disabled.
|
||||
async function shouldDisableCombineSarifFiles(sarifObjects, features, githubVersion) {
|
||||
// Never block on GHES versions before 3.18.0
|
||||
if (githubVersion.type === util_1.GitHubVariant.GHES &&
|
||||
semver.lt(githubVersion.version, "3.18.0")) {
|
||||
return false;
|
||||
if (githubVersion.type === util_1.GitHubVariant.GHES) {
|
||||
// Never block on GHES versions before 3.18.
|
||||
if (semver.lt(githubVersion.version, "3.18.0-0")) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// Never block when the feature flag is disabled.
|
||||
if (!(await features.getValue(feature_flags_1.Feature.DisableCombineSarifFiles))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if (areAllRunsUnique(sarifObjects)) {
|
||||
// If all runs are unique, we can safely combine them.
|
||||
return false;
|
||||
}
|
||||
return features.getValue(feature_flags_1.Feature.DisableCombineSarifFiles);
|
||||
// Combining SARIF files is not supported and Code Scanning will return an
|
||||
// error if multiple runs with the same category are uploaded.
|
||||
return true;
|
||||
}
|
||||
// Takes a list of paths to sarif files and combines them together using the
|
||||
// CLI `github merge-results` command when all SARIF files are produced by
|
||||
|
||||
Reference in New Issue
Block a user