Branch names are hard
This commit is contained in:
parent
28d74f5d9b
commit
64cfebc63c
8
build.go
8
build.go
|
@ -537,12 +537,18 @@ func getBranchSuffix() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
branch = string(parts[len(parts)-1])
|
branch = parts[len(parts)-1]
|
||||||
if branch == "master" {
|
if branch == "master" {
|
||||||
// master builds are the default.
|
// master builds are the default.
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
|
validBranchRe := regexp.MustCompile(`^[a-zA-Z0-9_.-]$`)
|
||||||
|
if !validBranchRe.MatchString(branch) {
|
||||||
|
// There's some odd stuff in the branch name. Better skip it.
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
|
||||||
return "-" + branch
|
return "-" + branch
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue