Jenkins Bitbucket Webhook infinite build loop issue

354 Views Asked by At

I have set up a pipeline job in Jenkins which push changes to Bitbucket. This causes a new build trigger in Jenkins. How to avoid Jenkins job build if the commit is from Jenkins pipeline itself? Thank you.

1

There are 1 best solutions below

1
On

One option is to make the pipeline ignore commits by the user your pipeline job uses to push commits as described in this article.

The other option is to set a specific commit message in your pipeline that pushes code, and to check for that message in the pipeline that gets triggered. If the message matches, then abort the build (or skip to the end if you want the build status to show success).