fix semver parsing by removing

This commit is contained in:
ddivad195
2024-03-05 16:18:19 +00:00
committed by David Daly
parent a4456b225e
commit 2fabbad58f
3 changed files with 4 additions and 3 deletions
+2
View File
@@ -1,6 +1,8 @@
# Dependency directory
node_modules
.npmrc
# Rest pulled from https://github.com/github/gitignore/blob/master/Node.gitignore
# Logs
logs
Generated Vendored
+1 -1
View File
@@ -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.`);
}
+1 -2
View File
@@ -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
}