Open Impakt opened 3 years ago
This is by design; see https://github.com/jenkinsci/branch-api-plugin/blob/c520eb2c5c5e9071129a1afa251b5a9ebb9a69ce/src/main/resources/jenkins/branch/BranchNameContributor/buildEnv.properties https://github.com/jenkinsci/branch-api-plugin/blob/c520eb2c5c5e9071129a1afa251b5a9ebb9a69ce/src/main/java/jenkins/branch/BranchNameContributor.java
If you need the author of the commit, perhaps you can get it by running git log -1 --format="%an <%ae>"
and capturing the output. Except this will use the merge commit if Jenkins is building the result of merging the pull request.
If you instead need the person who pushed to the source branch of the pull request, then that's https://github.com/jenkinsci/bitbucket-branch-source-plugin/issues/413.
Version report
Jenkins and plugins versions report:
Results
Expected result: When pushing to a branch other than develop/master (in other words another branch with a PR), I was hoping the plug-in would set
CHANGE_AUTHOR
andCHANGE_AUTHOR_EMAIL
to the author of the latest push which triggered the build. The person who triggered the change appears correctly in the Jenkins UI (both blueocean and the classic UI).Actual result:
The creator of the PR is used as the
CHANGE_AUTHOR
andCHANGE_AUTHOR_EMAIL
instead.