build-user-vars-plugin icon indicating copy to clipboard operation
build-user-vars-plugin copied to clipboard

Set GitHub push user as BUILD_USER_ID

Open irissmann opened this issue 9 years ago • 1 comments

The GitHub plugin provides the id of the user who triggers a build by a push to GitHub. We would like to set this user in the environment variable BUILD_USER_ID.

irissmann avatar Jun 27 '16 14:06 irissmann

I fully agree that this is an ugly hack. Unfortunately pushedBy is a private member with no getter :( https://github.com/jenkinsci/github-plugin/blob/master/src/main/java/com/cloudbees/jenkins/GitHubPushCause.java And this is useful information, which just simply isn't exposed anywhere.

EDIT: Ah well, I guess the intended way is to register ourselves here:

  • https://github.com/jenkinsci/github-plugin/blob/150fc933aa397e7fa997434e61427db05de1007d/src/main/java/org/jenkinsci/plugins/github/webhook/subscriber/DefaultPushGHEventSubscriber.java#L107

marc-guenther avatar Jan 19 '17 17:01 marc-guenther