2

I have Jenkins pipeline, and configured github webhook to trigger pipeline.

How to make triggering pipeline when the certain branch was pushed, instead of triggering pipeline by pushing to every branch ?

Igor Vlasuyk
  • 514
  • 2
  • 10
  • 22

1 Answers1

4

Webhook is generic for all, there is no filter on the side github or bitbucket, all you need to handle based on payload.

you can use Generic+Webhook+Trigger+Plugin,The plugin will allow you to parse certain data from the payload, and can conditionally trigger a build depending on the branch name.

Apply the filter with branch name

enter image description here

generic-webhook-trigger-plugin-specific-branch

Adiii
  • 54,482
  • 7
  • 145
  • 148
  • 1
    **important:** I had to specify Jenkins's URL for github webhook in this way `http://some_user:some_password@JENKINS_HOST:JENKINS_PORT/generic-webhook-trigger/invoke` – Igor Vlasuyk Sep 25 '19 at 15:27