When you create a Jenkins job, how will Jenkins know when it's time to build a specific branch or pull request? Jenkins offers many ways to do this, from continuously building based on a timer, to polling the Git repository to see if anything changed. Both of these options are not very efficient, but luckily GitHub allows for a better solution.
GitHub has the concept of Webhooks, which means that it can be configured to contact a server, such as our Jenkins instance, when something important happens.
There are many ways to achieve the goal, but in this recipe we will focus on one approach, which is going to be helpful especially in an enterprise environment where a GitHub organization is used, containing several repositories. Managing a single job or more per repository can quickly become a repetitive chore and that is where the GitHub Branch Source plugin comes into play.