I have a bit different requirement. I have a Jenkins job that is being triggered by a webhook. It is a Post Receive hook in the Bitbucket.
The webhook works and the job get triggered. The thing is the job needs to edit a file in the repo and then commit the same file back to the repo. This also works, but once the file is pushed to the repo, it triggers another build in Jenkins. Leading to chain reaction scenario.
What I want to do here is, when I commit and push the file from the Jenkins job, the file should get pushed to the repo, but the webhook should not trigger for this particular file. If any other file is modified and pushed, the webhook should trigger and hence the Jenkins job as well.
Is there any configuration that we can do in the Bitbucket webhook so that if simply do not trigger if a particular file is pushed?