问题
I am using Jenkins with the Github Plugin I have integrated it using GitHub's webhooks and it works like a charm, except that builds get triggered everytime something is pushed to the repository.
Is there a way to limit builds only when a change to the remote branch master
has been made?
回答1:
Action Plan
- Open the Jenkins job Configuration
- Go to the section Source Code Managment
- In the Git section
- For the field Branches to build add the value */master
This tells this Jenkins Job, to only execute the job, when something is pushed to the branch master.
Figure: Shows the configuration, for building only branch master.
来源:https://stackoverflow.com/questions/33113400/trigger-build-only-on-pushes-to-master