Skip to content

Commit 3789209

Browse files
fix: ignore invalid release tags (#33)
* fix(getLatestRelease): only consider semrel tags * make filter function anonymous and inline Co-authored-by: Artem Zakharchenko <[email protected]> * patched up filter Co-authored-by: Artem Zakharchenko <[email protected]>
1 parent 7449176 commit 3789209

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/utils/git/getLatestRelease.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ export function byReleaseVersion(left: string, right: string): number {
88
export async function getLatestRelease(
99
tags: string[],
1010
): Promise<TagPointer | undefined> {
11-
const allTags = tags.sort(byReleaseVersion)
11+
const allTags = tags.filter((tag) => {
12+
return semver.valid(tag)
13+
}).sort(byReleaseVersion)
1214
const [latestTag] = allTags
1315

1416
if (!latestTag) {

0 commit comments

Comments
 (0)