Search code examples
githubjenkinsjenkins-pipelinejenkins-2

How to trigger a Jenkins 2.0 Pipeline job from a GitHub pull request


It looks like the GitHubPullRequestBuilder is not compatible with Jenkins v2.0 pipeline jobs.

How do you configure a pipeline job to be triggered from a GitHub pull request event?
The documentation on this topic is sparse and I cannot find any examples of this. Or is it better to create a web-hook in GitHub to trigger the pipeline job on the PR event?


Solution

  • The most straightforward way to use Pipeline with GitHub pull requests is to put the script into your repository under the name Jenkinsfile and then install the GitHub Branch Source plugin. Documentation