Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drone CI: Wrong branch reported for PRs #457

Open
abrain opened this issue Feb 6, 2021 · 0 comments
Open

Drone CI: Wrong branch reported for PRs #457

abrain opened this issue Feb 6, 2021 · 0 comments
Assignees

Comments

@abrain
Copy link

abrain commented Feb 6, 2021

When uploading the coverage report for a Pull Request using Drone CI, the result is attributed to the target branch of the Pull Request.

Situation: I want to merge the branch feature/foo into the branch develop of the same repo and open a PR for it. Whenever the PR gets tested, the results on Code Climate for develop are overwritten with the results from the PR.

On Drone CI, the test-reporter tries to determine the branch from the DRONE_BRANCH environment variable.

var gitBranchVars = []string{"GIT_BRANCH", "APPVEYOR_REPO_BRANCH", "BRANCH_NAME", "BUILDKITE_BRANCH", "CIRCLE_BRANCH", "CI_BRANCH", "CI_BUILD_REF_NAME", "DRONE_BRANCH", "HEROKU_TEST_RUN_BRANCH", "TRAVIS_PULL_REQUEST_BRANCH", "TRAVIS_BRANCH", "WERCKER_GIT_BRANCH", "CI_COMMIT_REF_NAME", "BITRISE_GIT_BRANCH"}

For push events this is fine, but for Pull Requests it contains the target branch of the PR, not the source branch. As far as I can tell, there is no single environment variable that would fit the purpose. As a workaround, I use a script to set GIT_BRANCH to the correct branch before uploading.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants