Skip to content

Commit dd0f43a

Browse files
fix: add filter for release tags (#5)
1 parent 33b5cca commit dd0f43a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ async function main() {
8585
}
8686

8787
function getLatestRelease(releases: Release[], prefix: string): Release | undefined {
88-
return releases.filter(release => release.tag_name.startsWith(prefix))
88+
const regex = new RegExp(`^${prefix}\\d+\\.\\d+\\.\\d+$`);
89+
90+
return releases.filter(release => release.tag_name.match(regex) !== null)
8991
.sort((a, b) => Date.parse(a.created_at) - Date.parse(b.created_at))
9092
.pop();
9193
}

0 commit comments

Comments
 (0)