From 2fabbad58fecc27b8ea2ffd901c60068c66d62e3 Mon Sep 17 00:00:00 2001 From: ddivad195 Date: Tue, 5 Mar 2024 16:18:19 +0000 Subject: [PATCH] fix semver parsing by removing --- .gitignore | 2 ++ dist/index.js | 2 +- src/main.ts | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 47fb503..6d847b1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # Dependency directory node_modules +.npmrc + # Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore # Logs logs diff --git a/dist/index.js b/dist/index.js index 9ec1b06..4b1191c 100644 --- a/dist/index.js +++ b/dist/index.js @@ -128343,7 +128343,7 @@ function parseSemverTagFromRef(ref) { throw new Error(`The ref ${ref} is not a valid tag reference.`); } const rawTag = ref.replace(/^refs\/tags\//, ''); - const semverTag = semver_1.default.parse(rawTag); + const semverTag = semver_1.default.parse(rawTag.replace(/^v/, '')); if (!semverTag) { throw new Error(`${rawTag} is not a valid semantic version tag, and so cannot be uploaded to the action package.`); } diff --git a/src/main.ts b/src/main.ts index bbf638d..51e0ef4 100644 --- a/src/main.ts +++ b/src/main.ts @@ -83,13 +83,12 @@ function parseSemverTagFromRef(ref: string): semver.SemVer { } const rawTag = ref.replace(/^refs\/tags\//, '') - const semverTag = semver.parse(rawTag) + const semverTag = semver.parse(rawTag.replace(/^v/, '')) if (!semverTag) { throw new Error( `${rawTag} is not a valid semantic version tag, and so cannot be uploaded to the action package.` ) } - return semverTag }