build-user-vars-plugin
                                
                                
                                
                                    build-user-vars-plugin copied to clipboard
                            
                            
                            
                        Set GitHub push user as BUILD_USER_ID
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.
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