Nijo
Nijo

Reputation: 841

Github not triggering job when pull request is created to branch

I need to run a jenkins job when PR is created to my staging branch in github. The jenkins will run some test cases and return the results to github and after that only we can merge the PR to the staging branch.

I'm using GitHub pull request builder plugin in jenkins. But my job in jenkins is not getting triggered when PR is created. The webhook from github is show 200 status and its working to buid a jenkins job for github push.

I followed https://medium.com/@mreigen/integrate-jenkins-builds-into-github-pull-requests-33bc053d6210 steps.

Can anybody help me with This!

Upvotes: 2

Views: 3815

Answers (1)

VonC
VonC

Reputation: 1324347

Check the Jenkins logs first.

For example, jenkinsci/ghprb-plugin issue 286 mentioned:

It looks like GitHub is sending the wrong kind of events.

  • The plugin only accepts pull_request and issue_comment events.
  • GitHub is sending a push event, so I am not sure but you might have configured the webhook using a different plugin?

Check your master config and make sure you are only telling the job triggers to use webhooks. Also, make sure you have checked the box in each job you want that says to build using webhooks.

Issue 603 involved the option "Use github hooks for build triggering", but mention an Hook URL issue.

Upvotes: 1

Related Questions