Reputation: 121
I have followed https://plugins.jenkins.io/ghprb/ and created Jenkins job. I created Gitwebhook http://:/ghprbhook/. Selected the “Let me select individual events” option and selected just the “Pull requests” option. I can see green tick in for that hook. Selected Github project option and entered the Github repo URL for which I want the PR builds without .git extension.Selected Git SCM.Added GitHub "Repository URL".Under Advanced, set "refspec" to +refs/pull/:refs/remotes/origin/pr/. In "Branch Specifier", entered ${sha1}. Under "Build Triggers", checked "Github pull requests builder". Added myself as admin.Checked "Use github hooks for build triggering". But If I create a PR it does not trigger this job. Please help on this.
Upvotes: 0
Views: 4631
Reputation: 179
Follow the below steps and try this, it would work for you.
Paste your repository URL
select your credential
Click Advanced Section
origin
+refs/pull/${ghprbPullId}/*:refs/remotes/origin/pr/${ghprbPullId}/*
${ghprbActualCommit}
Under Build Triggers
Use github hooks for build triggering
Build every pull request automatically without asking (Dangerous!)
Thanks
Upvotes: 2