Skip to content

Commit

Permalink
Ignore github ref
Browse files Browse the repository at this point in the history
  • Loading branch information
plorenz committed Nov 16, 2020
1 parent 1ba9ae8 commit eccb9d8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions cmd/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,12 @@ func (cmd *BaseCommand) GetCurrentBranch() string {
} else if val, found := os.LookupEnv("TRAVIS_BRANCH"); found && val != "" {
branchName = val
cmd.Infof("got branch name=%v from environment variable=TRAVIS_BRANCH\n", branchName)
} else if val, found := os.LookupEnv("GITHUB_REF"); found && val != "" {
branchName = val
if strings.HasPrefix(branchName, "refs/heads/") {
branchName = strings.TrimPrefix(branchName, "refs/heads/")
}
cmd.Infof("got branch name=%v from environment variable=GITHUB_REF\n", branchName)
//} else if val, found := os.LookupEnv("GITHUB_REF"); found && val != "" {
// branchName = val
// if strings.HasPrefix(branchName, "refs/heads/") {
// branchName = strings.TrimPrefix(branchName, "refs/heads/")
// }
// cmd.Infof("got branch name=%v from environment variable=GITHUB_REF\n", branchName)
} else {
branchName = cmd.GetCmdOutputOneLine("get git branch (rev-parse)", "git", "rev-parse", "--abbrev-ref", "HEAD")
if branchName == "HEAD" {
Expand Down

0 comments on commit eccb9d8

Please sign in to comment.