Skip to content

Commit

Permalink
Merge pull request #190 from mattn/more/jenkins-vars
Browse files Browse the repository at this point in the history
Add support for Jenkins multibranch projects environment variables
  • Loading branch information
gdm85 authored Nov 7, 2020
2 parents c9edce9 + a35d1a6 commit f1c5f0d
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions goveralls.go
Original file line number Diff line number Diff line change
Expand Up @@ -379,9 +379,6 @@ func process() error {
pullRequest = prNumber
} else if prNumber := os.Getenv("TRAVIS_PULL_REQUEST"); prNumber != "" && prNumber != "false" {
pullRequest = prNumber
} else if prURL := os.Getenv("CI_PULL_REQUEST"); prURL != "" {
// for Circle CI
pullRequest = regexp.MustCompile(`[0-9]+$`).FindString(prURL)
} else if prNumber := os.Getenv("APPVEYOR_PULL_REQUEST_NUMBER"); prNumber != "" {
pullRequest = prNumber
} else if prNumber := os.Getenv("PULL_REQUEST_NUMBER"); prNumber != "" {
Expand All @@ -394,6 +391,15 @@ func process() error {
pullRequest = prNumber
} else if prNumber := os.Getenv("CI_PR_NUMBER"); prNumber != "" {
pullRequest = prNumber
} else if prNumber := os.Getenv("CHANGE_ID"); prNumber != "" {
// for Jenkins multibranch projects
pullRequest = prNumber
} else if prURL := os.Getenv("CHANGE_URL"); prURL != "" {
// for Jenkins multibranch projects
pullRequest = regexp.MustCompile(`[0-9]+$`).FindString(prURL)
} else if prURL := os.Getenv("CI_PULL_REQUEST"); prURL != "" {
// for Circle CI
pullRequest = regexp.MustCompile(`[0-9]+$`).FindString(prURL)
} else if os.Getenv("GITHUB_EVENT_NAME") == "pull_request" {
number := githubEvent["number"].(float64)
pullRequest = strconv.Itoa(int(number))
Expand Down

0 comments on commit f1c5f0d

Please sign in to comment.