Skip to content

Commit

Permalink
Support prow
Browse files Browse the repository at this point in the history
Instead of requiring to map the prow env vars to other values, directly
use the env vars defined here:

https://github.com/kubernetes/test-infra/blob/master/prow/jobs.md#job-environment-variables
  • Loading branch information
dhiller committed Aug 27, 2020
1 parent 21feffd commit 653cfb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions gitinfo.go
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ var varNames = [...]string{
"CI_BRANCH", "APPVEYOR_REPO_BRANCH",
"WERCKER_GIT_BRANCH", "DRONE_BRANCH",
"BUILDKITE_BRANCH", "BRANCH_NAME",
"PULL_REFS",
}

func loadBranchFromEnv() string {
Expand Down
2 changes: 2 additions & 0 deletions goveralls.go
Original file line number Diff line number Diff line change
Expand Up @@ -383,6 +383,8 @@ func process() error {
pullRequest = prNumber
} else if prNumber := os.Getenv("CI_PR_NUMBER"); prNumber != "" {
pullRequest = prNumber
} else if prNumber := os.Getenv("PULL_NUMBER"); prNumber != "" {
pullRequest = prNumber
} else if os.Getenv("GITHUB_EVENT_NAME") == "pull_request" {
number := githubEvent["number"].(float64)
pullRequest = strconv.Itoa(int(number))
Expand Down

0 comments on commit 653cfb7

Please sign in to comment.