mirror of
https://github.com/PaulHatch/semantic-version.git
synced 2026-04-23 14:54:27 +00:00
Allow slashes in tag prefix
This commit is contained in:
parent
8e99275875
commit
27c5676700
3 changed files with 36 additions and 6 deletions
15
dist/index.js
vendored
15
dist/index.js
vendored
|
|
@ -1099,9 +1099,18 @@ const setOutput = (major, minor, patch, increment, changed, branch, namespace) =
|
|||
|
||||
const parseVersion = (tag) => {
|
||||
|
||||
console.log(tag);
|
||||
let tagParts = tag.split('/');
|
||||
let versionValues = tagParts[tagParts.length - 1]
|
||||
let stripedTag;
|
||||
if (tagPrefix.includes('/') && tag.includes(tagPrefix)) {
|
||||
let tagParts = tag
|
||||
.replace(tagPrefix, '<--!PREFIX!-->')
|
||||
.split('/');
|
||||
stripedTag = tagParts[tagParts.length - 1]
|
||||
.replace('<--!PREFIX!-->', tagPrefix);
|
||||
} else {
|
||||
let tagParts = tag.split('/');
|
||||
stripedTag = tagParts[tagParts.length - 1];
|
||||
}
|
||||
let versionValues = stripedTag
|
||||
.substr(tagPrefix.length)
|
||||
.slice(0, namespace === '' ? 999 : -(namespace.length + 1))
|
||||
.split('.');
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue