diff --git a/release/tag.groovy b/release/tag.groovy index acfdb09..a6bbd28 100644 --- a/release/tag.groovy +++ b/release/tag.groovy @@ -16,11 +16,17 @@ def LinkedHashMap startswithspecialprefix(String releasetag) { def String prefixfound = '' def String tagwithoutprefix = releasetag + // Two forms of releasetag expected + // __ + // _ + def int seperatorcount = releasetag.split(RELEASETAG_PREFIX_SEPERATOR).size() - 1 def firstseperatorindex = releasetag.indexOf(RELEASETAG_PREFIX_SEPERATOR) - if (firstseperatorindex > 0) { - prefixfound = releasetag[0..(firstseperatorindex - 1)].toLowerCase() - hasspecialprefix = RELEASETAG_PREFIXES.containsKey(prefixfound) - tagwithoutprefix = releasetag[(firstseperatorindex + 1)..-1] + if (separatorcount >= 2) { + if (firstseperatorindex > 0) { + prefixfound = releasetag[0..(firstseperatorindex - 1)].toLowerCase() + hasspecialprefix = RELEASETAG_PREFIXES.containsKey(prefixfound) + tagwithoutprefix = releasetag[(firstseperatorindex + 1)..-1] + } } return [ 'hasspecialprefix' : hasspecialprefix, 'prefixfound' : prefixfound,