Prevent the automationDetails to be regenerated if it already exists

This commit is contained in:
David Verdeguer 2021-04-16 07:47:42 +02:00
parent 47755f0910
commit de611b2de3
3 changed files with 11 additions and 7 deletions

8
lib/upload-lib.js generated
View file

@ -61,9 +61,11 @@ function populateRunAutomationDetails(sarifContents, analysis_key, environment)
}
const sarif = JSON.parse(sarifContents);
for (const run of sarif.runs || []) {
run.automationDetails = {
id: automationID,
};
if (run.automationDetails === undefined) {
run.automationDetails = {
id: automationID,
};
}
}
return JSON.stringify(sarif);
}

File diff suppressed because one or more lines are too long

View file

@ -63,9 +63,11 @@ export function populateRunAutomationDetails(
const sarif = JSON.parse(sarifContents);
for (const run of sarif.runs || []) {
run.automationDetails = {
id: automationID,
};
if (run.automationDetails === undefined) {
run.automationDetails = {
id: automationID,
};
}
}
return JSON.stringify(sarif);