Skip to content
This repository was archived by the owner on Dec 19, 2025. It is now read-only.

Commit bd8002d

Browse files
committed
Sort tags from REST API in case of inconsistencies
1 parent b2fa7d1 commit bd8002d

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

packages/core/src/query/rest.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,12 @@ const rest: CheckFunction = async function(options: CheckOptions): Promise<Check
5454
}
5555

5656
if (options.fetchTags) {
57-
result.update = tag(compareTags(options, response.data))
57+
// sort tags using semver.compare
58+
// in case the tag names are inconsistent (e.g. 1.0.0 => 2.0.0 => v3.0.0)
59+
const responseData = (response.data as Array<RestResponseTag>)
60+
.sort((a, b) => semver.compare(a.name, b.name))
61+
.reverse()
62+
result.update = tag(compareTags(options, responseData))
5863
}
5964
else {
6065
result.update = release(compareReleases(options, response.data))

0 commit comments

Comments
 (0)