From 09ea049cd91482084e794fc613ef67b4e58c6391 Mon Sep 17 00:00:00 2001 From: Rhys Arkins Date: Fri, 8 Mar 2024 20:35:03 +0100 Subject: [PATCH] fix(versioning/swift): restore exact version support (#27789) --- lib/modules/versioning/swift/index.spec.ts | 1 + lib/modules/versioning/swift/index.ts | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/lib/modules/versioning/swift/index.spec.ts b/lib/modules/versioning/swift/index.spec.ts index dd733bd6b489a9..b1282c6a55a874 100644 --- a/lib/modules/versioning/swift/index.spec.ts +++ b/lib/modules/versioning/swift/index.spec.ts @@ -98,6 +98,7 @@ describe('modules/versioning/swift/index', () => { it.each` version | range | expected + ${'1.2.3'} | ${'1.2.3'} | ${true} ${'1.2.4'} | ${'..."1.2.4"'} | ${true} ${'v1.2.4'} | ${'..."1.2.4"'} | ${true} ${'1.2.4'} | ${'..."1.2.3"'} | ${false} diff --git a/lib/modules/versioning/swift/index.ts b/lib/modules/versioning/swift/index.ts index a6135eaa73221d..a67d5699cc7678 100644 --- a/lib/modules/versioning/swift/index.ts +++ b/lib/modules/versioning/swift/index.ts @@ -62,6 +62,10 @@ function isLessThanRange(version: string, range: string): boolean { } function matches(version: string, range: string): boolean { + // Check if both are an exact version + if (valid(range) && version === range) { + return true; + } const semverRange = toSemverRange(range); return semverRange ? satisfies(version, semverRange) : false; }