I need to find the git username/email of a person who is pushing changes, consisting of different commits by different users, to a remote repository.
The push triggers a Post-Receive hook via gitblit which triggers a jenkins job, and is using a non user specific SSH authentication.
I had to
.
def triggerUrl = jenkinsUrl + "/job/" + jenkinsJob + "/buildWithParameters?token=" + jenkinsToken + "&myuser=" + user.getName()
new URL(triggerUrl).getText()
myuser is now an enviroment variable, here as an example in an ant script :
<property environment="env" />
<target name="xx" description="xx">
<echo message="${env.myuser}" />
</target>