mirror of
https://github.com/github/codeql-action.git
synced 2026-10-31 09:59:43 +00:00
add rebuilt lib
This commit is contained in:
18
lib/util.js
generated
18
lib/util.js
generated
@@ -673,11 +673,6 @@ function removeDuplicateLocations(locations) {
|
||||
});
|
||||
}
|
||||
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)) {
|
||||
return sarif;
|
||||
}
|
||||
@@ -728,9 +723,16 @@ function fixInvalidNotifications(sarif, logger) {
|
||||
}
|
||||
exports.fixInvalidNotifications = fixInvalidNotifications;
|
||||
function fixInvalidNotificationsInFile(inputPath, outputPath, logger) {
|
||||
let sarif = JSON.parse(fs.readFileSync(inputPath, "utf8"));
|
||||
sarif = fixInvalidNotifications(sarif, logger);
|
||||
fs.writeFileSync(outputPath, JSON.stringify(sarif));
|
||||
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.`);
|
||||
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;
|
||||
function wrapError(error) {
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user