Skip to content

Commit

Permalink
Merge pull request #19 from projectsyn/fix/version-listing
Browse files Browse the repository at this point in the history
Switch `latestTag()` to discard all tags except for full SemVer tags
  • Loading branch information
simu authored Nov 6, 2023
2 parents e901833 + ab54450 commit 36cfb86
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion __tests__/version.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ describe('latestTag', () => {
'v1.0.0',
'v1.2.2',
'foo-v1.0.0',
'bar'
'bar',
'v1'
)
getOctokitMock.mockImplementation(clientMock.mockFn)

Expand Down
2 changes: 1 addition & 1 deletion dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src/version.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export async function latestTag(): Promise<string> {
const tags = tagsResp
.map(({ name }) => name)
.filter(tag => {
return tag.startsWith('v')
return /^v\d+\.\d+\.\d+$/.test(tag)
})
.sort(rcompare)

Expand Down

0 comments on commit 36cfb86

Please sign in to comment.