From 5961cf9c4dfdab0d0ca4bab9f1d2403960331ef8 Mon Sep 17 00:00:00 2001 From: Mathieu Dutour Date: Thu, 18 Feb 2021 10:32:06 +0100 Subject: [PATCH] fix typo --- package-lock.json | 2 +- src/action.ts | 2 +- src/utils.ts | 8 ++++++-- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index 8cbd18154..7a7677bf0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "github-tag-action", - "version": "5.1.0", + "version": "5.2.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/src/action.ts b/src/action.ts index 6d5994b27..a64543fdf 100644 --- a/src/action.ts +++ b/src/action.ts @@ -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, diff --git a/src/utils.ts b/src/utils.ts index 2bcc485bb..63945a37f 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -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', },