I have a Jenkins Pipeline job which is triggered of a github webhook, so on a commit to Github the build gets triggered. However, I only want the build to be triggered when a commit is made to the master branch. Currently any commit triggers a build even if the commit is made on a feature branch.
Is there any way to achieve this without resorting to a multibranch job?
I can't see any way to filter on branch (for the trigger) in the Jenkins config, the jenkinsfile or in the Github repo's webhook.
The only branch specific information I can find is which branch the code will build from but a commit to any other branch will still 'trigger' a build.
Can anyone help?