This commit is contained in:
David Verdeguer
2021-04-19 09:59:18 +02:00
parent 351d36fd18
commit d8a3eafc18
3 changed files with 10 additions and 1 deletions
+4
View File
@@ -47,6 +47,7 @@ exports.combineSarifFiles = combineSarifFiles;
// Populates the run.automationDetails.id field using the analysis_key and environment
// and return an updated sarif file contents.
function populateRunAutomationDetails(sarifContents, analysis_key, environment) {
console.log("populateRunAutomationDetails");
if (analysis_key === undefined) {
return sarifContents;
}
@@ -58,6 +59,8 @@ function populateRunAutomationDetails(sarifContents, analysis_key, environment)
automationID += `${entry[0]}:${entry[1]}/`;
}
}
console.log("automationID");
console.log(automationID);
const sarif = JSON.parse(sarifContents);
for (const run of sarif.runs || []) {
if (run.automationDetails === undefined) {
@@ -238,6 +241,7 @@ async function uploadFiles(sarifFiles, repositoryNwo, commitOid, ref, analysisKe
for (const file of sarifFiles) {
validateSarifFileSchema(file, logger);
}
console.log("upload files");
let sarifPayload = combineSarifFiles(sarifFiles);
sarifPayload = fingerprints.addFingerprints(sarifPayload, checkoutPath, logger);
sarifPayload = populateRunAutomationDetails(sarifPayload, analysisKey, environment);
File diff suppressed because one or more lines are too long