add rebuilt lib
This commit is contained in:
parent
3100e1e354
commit
dddabd0d26
2 changed files with 11 additions and 9 deletions
18
lib/util.js
generated
18
lib/util.js
generated
|
|
@ -673,11 +673,6 @@ function removeDuplicateLocations(locations) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
function fixInvalidNotifications(sarif, logger) {
|
function fixInvalidNotifications(sarif, logger) {
|
||||||
if (process.env[shared_environment_1.CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX] === "true") {
|
|
||||||
logger.info("SARIF notification object duplicate location fix disabled by the " +
|
|
||||||
`${shared_environment_1.CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX} environment variable.`);
|
|
||||||
return sarif;
|
|
||||||
}
|
|
||||||
if (!Array.isArray(sarif.runs)) {
|
if (!Array.isArray(sarif.runs)) {
|
||||||
return sarif;
|
return sarif;
|
||||||
}
|
}
|
||||||
|
|
@ -728,9 +723,16 @@ function fixInvalidNotifications(sarif, logger) {
|
||||||
}
|
}
|
||||||
exports.fixInvalidNotifications = fixInvalidNotifications;
|
exports.fixInvalidNotifications = fixInvalidNotifications;
|
||||||
function fixInvalidNotificationsInFile(inputPath, outputPath, logger) {
|
function fixInvalidNotificationsInFile(inputPath, outputPath, logger) {
|
||||||
let sarif = JSON.parse(fs.readFileSync(inputPath, "utf8"));
|
if (process.env[shared_environment_1.CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX] === "true") {
|
||||||
sarif = fixInvalidNotifications(sarif, logger);
|
logger.info("SARIF notification object duplicate location fix disabled by the " +
|
||||||
fs.writeFileSync(outputPath, JSON.stringify(sarif));
|
`${shared_environment_1.CODEQL_ACTION_DISABLE_DUPLICATE_LOCATION_FIX} environment variable.`);
|
||||||
|
fs.renameSync(inputPath, outputPath);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let sarif = JSON.parse(fs.readFileSync(inputPath, "utf8"));
|
||||||
|
sarif = fixInvalidNotifications(sarif, logger);
|
||||||
|
fs.writeFileSync(outputPath, JSON.stringify(sarif));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
exports.fixInvalidNotificationsInFile = fixInvalidNotificationsInFile;
|
exports.fixInvalidNotificationsInFile = fixInvalidNotificationsInFile;
|
||||||
function wrapError(error) {
|
function wrapError(error) {
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue