mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-05-14 20:16:36 +00:00
internal/build: parse buildbot tag better
This commit is contained in:
parent
c78ea526b8
commit
29685bbe91
1 changed files with 3 additions and 4 deletions
|
|
@ -97,11 +97,10 @@ func Env() Environment {
|
||||||
// we can distinguish them by the git refspec.
|
// we can distinguish them by the git refspec.
|
||||||
var branch, tag string
|
var branch, tag string
|
||||||
branchSpec := os.Getenv("BUILD_BRANCH")
|
branchSpec := os.Getenv("BUILD_BRANCH")
|
||||||
switch {
|
if strings.HasPrefix(branchSpec, "refs/tags/") {
|
||||||
case strings.HasPrefix(branchSpec, "refs/heads/"):
|
|
||||||
branch = strings.TrimPrefix(branchSpec, "refs/heads/")
|
|
||||||
case strings.HasPrefix(branchSpec, "refs/tags/"):
|
|
||||||
tag = strings.TrimPrefix(branchSpec, "refs/tags/")
|
tag = strings.TrimPrefix(branchSpec, "refs/tags/")
|
||||||
|
} else {
|
||||||
|
branch = branchSpec
|
||||||
}
|
}
|
||||||
|
|
||||||
commit := os.Getenv("BUILD_COMMIT")
|
commit := os.Getenv("BUILD_COMMIT")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue