excluding specific users to trigger jenkins job when using webhooks

806 Views Asked by At

We have configured git webhooks to trigger Jenkins build jobs if any changes committed to the git with new change. but here we are facing one issue, whenever the Jenkins job runs successfully we are updating the pom with new version in the git So webhooks again triggering the Jenkins job and it is leading to infinite loop of triggers. So How can we fix this please suggest some steps if any familiar.

1

There are 1 best solutions below

0
On

One way is to use git log $GIT_PREVIOUS_COMMIT..$GIT_COMMIT --pretty=format:%an to get the name of the last committer as I have responded here.

Or as it can be seen in the same discussion you can pass the username as part of the webhook.