I have a job that gets built in two ways :
- IF someone commits to the github repo , triggering the job.
- IF someone manually builds the job.
within my pipeline, I need to get the name/info of person who triggered the build either directly (manually) or indirectly(SCM commit). I have the following code:
node('slave'){
wrap([$class: 'BuildUser']) {
return BUILD_USER
}
}
This gets me the name using the https://wiki.jenkins-ci.org/display/JENKINS/Build+User+Vars+Plugin plugin.
This works on manual but always gives SCM trigger when through SCM trigger. How do I get the name/info of the person who committed for the trigger to happen via SCM ?