Skip to content

Commit

Permalink
fix(lookup): return single version if only one matching (#27509)
Browse files Browse the repository at this point in the history
  • Loading branch information
rarkins authored Feb 22, 2024
1 parent fe56ee0 commit b9d0a30
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/workers/repository/process/lookup/current.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ export function getCurrentVersion(
let useVersions = allVersions.filter((v) =>
versioning.matches(v, currentValue),
);
if (useVersions.length === 1) {
return useVersions[0];
}
if (latestVersion && versioning.matches(latestVersion, currentValue)) {
useVersions = useVersions.filter(
(v) => !versioning.isGreaterThan(v, latestVersion),
Expand Down

0 comments on commit b9d0a30

Please sign in to comment.