-->

Trigger build only on pushes to master

2020-08-13 02:30发布

问题:

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.