# GitHub build trigger on PR

**URL:** <https://community.jenkins.io/t/github-build-trigger-on-pr/1268>\
**Category:** Ask a question\
**Created:** [January 17, 2022, 4:27pm UTC](https://community.jenkins.io/t/github-build-trigger-on-pr/1268 "2022-01-17T16:27:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![JakubBiel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/jakubbiel/32/834_2.png) [@JakubBiel](https://community.jenkins.io/u/JakubBiel)\
**Post date:** [January 17, 2022, 4:27pm UTC](https://community.jenkins.io/t/github-build-trigger-on-pr/1268/1 "2022-01-17T16:27:20Z")

</div>

Hi, I would like to create an automatic build triggered by pull requests. Is there a way to do it without web hooks? My Jenkins runs in a private subnet

Thanks,  
Jakub

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [January 17, 2022, 4:35pm UTC](https://community.jenkins.io/t/github-build-trigger-on-pr/1268/2 "2022-01-17T16:35:24Z")

</div>

> [@JakubBiel](#):
>
> Hi, I would like to create an automatic build triggered by pull requests. Is there a way to do it without web hooks? My Jenkins runs in a private subnet

[![](https://europe1.discourse-cdn.com/flex013/uploads/jenkins/original/2X/b/bbfd33b34d2f92d3b12fd578bea94d3e53e7ff9d.jpeg "How to Forward Webhooks to Jenkins Behind a Firewall using Smee.io") ](https://www.youtube.com/watch?v=ULe7c-2aPYY)

A little older text description of the same idea:

> **[Getting Webhooks Behind that Firewall of Yours](https://www.cloudbees.com/blog/getting-webhooks-behind-firewall-yours)**
>
> CloudBees

---

<div class="post-metadata">

**Author:** ![JakubBiel](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/jakubbiel/32/834_2.png) [@JakubBiel](https://community.jenkins.io/u/JakubBiel)\
**Post date:** [January 17, 2022, 4:41pm UTC](https://community.jenkins.io/t/github-build-trigger-on-pr/1268/3 "2022-01-17T16:41:08Z")

</div>

Thank you Mark. Is that the only option? I was thinking that maybe Jenkins could poll SCM and trigger jobs for PRs but couldn’t find a definitive answer online.

---

<div class="post-metadata">

**Author:** ![MarkEWaite](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/markewaite/32/20_2.png) [@MarkEWaite](https://community.jenkins.io/u/MarkEWaite)\
**Post date:** [January 18, 2022, 5:21am UTC](https://community.jenkins.io/t/github-build-trigger-on-pr/1268/4 "2022-01-18T05:21:41Z")

</div>

Yes, you can schedule Jenkins to poll the remote repository. That polling can detect pull requests in plugins like the GitHub branch source plugin and the Gitea plugin. However, that means you’re wasting resources by asking periodic questions instead of being informed when something arrives.

> **[Polling must die: triggering Jenkins builds from a git hook - Kohsuke Kawaguchi](https://kohsuke.org/2011/12/01/polling-must-die-triggering-jenkins-builds-from-a-git-hook/)**
>
> As I keep saying, polling a repository from Jenkins is inefficient; it adds delay on the order of minutes before a build starts after a commit is pushed, and it adds additional loads. It is much better instead to do push-notification from the...

---

<div class="post-metadata">

**Author:** ![jaivigneshm0396](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/jaivigneshm0396/32/1284_2.png) [@jaivigneshm0396](https://community.jenkins.io/u/jaivigneshm0396)\
**Post date:** [April 11, 2022, 12:33pm UTC](https://community.jenkins.io/t/github-build-trigger-on-pr/1268/5 "2022-04-11T12:33:15Z")

</div>

Hi, I would like to create an automatic build triggered by push requests with web hooks. So i have configured with Jenkins URL. It has been worked for 1st build in My Jenkins project after that its not working, But in webhook logs its 200 success code. I have tried with [Smee.io](http://Smee.io) and ngrok also facing the same issues.
