25

I try to configure Jenkins. I want a simple behavior: trigger a build on new pull request.

So, I created a job and configured it, but I checked the checkbox for: enter image description here

And as you can see nothing is dropped down.

If I click the question mark on the right side, I see:

If jenkins will receive PUSH GitHub hook from repo defined in Git SCM section it will trigger Git SCM polling logic. So polling logic in fact belongs to Git SCM.

But where is the "Git SCM section"?

3 Answers 3

17

You need to configure the webhook on your GitHub repository. Then, on every commit push, Jenkins will be notified.

So, open your repository in the browser, then go to Settings > Webhooks and add a new one.

enter image description here

Then, enter the URL of your Jenkins instance followed by /github-webhook and select the other options depending on your needs:

enter image description here

3
  • Now in GitHub we have separate section WebHooks. May 23, 2020 at 5:46
  • the "just the push event" will work for PR creation?
    – Arnold Roa
    May 27, 2021 at 10:52
  • @ArnoldRoa I don't think so because there's a PullRequestEvent, you should probably select "send me everything".
    – fsinisi90
    May 27, 2021 at 20:28
9

I was also frustrated with this topic, this was needed for me to get job triggering working from GitHub MERGE:

  • GitHub repo -> Settings -> Webhooks -> push type webhook with URL: http(s)://host:<port>/github-webhook/

    For me, last slash was REQUIRED, did not work without it

  • In Jenkins System Settings, add GitHub Server, credential for it and [x] Manage hooks

  • Use Test settings button to test it works

  • In Job configuration, Source Code Management -> Git, add repo and credentials

  • Under Build triggers: [x] GitHub hook trigger for GITScm polling

  • In GitHub webhook settings, click webhook and it shows logs how it worked under "Recent Deliveries" title

0

It is a source code management section (before triggering section), uncheck "none" case and check git ou github case(depend to your version) and fill the input field with your git repo url and credentialenter image description here

1
  • 9
    This section does not exist in my UI
    – mafrosis
    May 20, 2018 at 3:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.