Skip to content

Commit

Permalink
fix: Skip unexpected version downgrades (#29921)
Browse files Browse the repository at this point in the history
  • Loading branch information
zharinov committed Jun 28, 2024
1 parent 522ce15 commit 1a06b1a
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion lib/workers/repository/process/lookup/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,22 @@ export async function lookupUpdates(
res.isSingleVersion ??=
is.string(update.newValue) &&
versioning.isSingleVersion(update.newValue);
res.updates.push(update);
// istanbul ignore if
if (
update.updateType !== 'rollback' &&
update.newValue &&
versioning.isVersion(update.newValue) &&
compareValue &&
versioning.isVersion(compareValue) &&
versioning.isGreaterThan(compareValue, update.newValue)
) {
logger.warn(
{ update, allVersions, filteredReleases },
'Unexpected downgrade detected: skipping',
);
} else {
res.updates.push(update);
}
}
} else if (compareValue) {
logger.debug(
Expand Down

0 comments on commit 1a06b1a

Please sign in to comment.