Skip to content

Commit

Permalink
fix typo
Browse files Browse the repository at this point in the history
  • Loading branch information
mathieudutour committed Feb 18, 2021
1 parent 7037405 commit 5961cf9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion package-lock.json

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

2 changes: 1 addition & 1 deletion src/action.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export default async function main() {
const prefixRegex = new RegExp(`^${tagPrefix}`);

const validTags = await getValidTags(prefixRegex);
const latestTag = getLatestTag(validTags, prefixRegex);
const latestTag = getLatestTag(validTags, prefixRegex, tagPrefix);
const latestPrereleaseTag = getLatestPrereleaseTag(
validTags,
identifier,
Expand Down
8 changes: 6 additions & 2 deletions src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,14 @@ export function getBranchFromRef(ref: string) {
return ref.replace('refs/heads/', '');
}

export function getLatestTag(tags: Tags, prefixRegex: RegExp) {
export function getLatestTag(
tags: Tags,
prefixRegex: RegExp,
tagPrefix: string
) {
return (
tags.find((tag) => !prerelease(tag.name.replace(prefixRegex, ''))) || {
name: `${prefixRegex}0.0.0`,
name: `${tagPrefix}0.0.0`,
commit: {
sha: 'HEAD',
},
Expand Down

0 comments on commit 5961cf9

Please sign in to comment.