Commit update should show actual user which has commit changes in gogs using Jenkin PipeLine

I have configure pipeline in jenkin with gogs repository, In that i have configure webhook with gogs and jenkin, Webhook is working properly with jenkin pipeline, but when different user made push request to gogs, In jenkin pipeline commit name is shown by different user. I need that it should show same username which commit request in gogs. can anybody tell what changes should i must made, so that above requirement is satisfy?

Hello @kashif.shaikh111 and welcome to this community :wave:

If I understand your request well, do you want the Jenkins logs to show which user is responsible for the commit the current job is building for?
I guess that the default behavior is displaying the credentials you used to fetch the latest commit.

If you want the latest commit’s username, try

git log -1 --pretty=format:'%an'

Hi Poddingue

Thanks for your support

In jenkin pipeline we can see username in change option and but it is not showing, by which actual gogs user has commit that request. It only shows generic credential which I have mention in it while configuring jenkin pipeline. I need that it should shows which actual gogs user username which is committing the changes. Also I would like to add that Iam using free style project option, so i cannot see option to add command which you have mention.

image

1 Like