Skip to content

Commit 20673fd

Browse files
committed
fix(utils): prevent mixed summary when some audit changed only value
1 parent d4668df commit 20673fd

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

packages/utils/src/lib/reports/generate-md-reports-diff.ts

+3-10
Original file line numberDiff line numberDiff line change
@@ -268,22 +268,15 @@ function changesToDiffOutcomes(changes: Change[]): DiffOutcome[] {
268268
}
269269

270270
function mergeDiffOutcomes(outcomes: DiffOutcome[]): DiffOutcome {
271-
if (outcomes.length === 0) {
271+
if (outcomes.every(outcome => outcome === 'unchanged')) {
272272
return 'unchanged';
273273
}
274-
if (
275-
outcomes.every(outcome => outcome === 'positive' || outcome === 'unchanged')
276-
) {
274+
if (outcomes.includes('positive') && !outcomes.includes('negative')) {
277275
return 'positive';
278276
}
279-
if (
280-
outcomes.every(outcome => outcome === 'negative' || outcome === 'unchanged')
281-
) {
277+
if (outcomes.includes('negative') && !outcomes.includes('positive')) {
282278
return 'negative';
283279
}
284-
if (outcomes.every(outcome => outcome === 'unchanged')) {
285-
return 'unchanged';
286-
}
287280
return 'mixed';
288281
}
289282

0 commit comments

Comments
 (0)