Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

You can prevent Jenkins from initiating a pull request build for a particular branch by applying a regular expression match in the branch specifier section of the Jenkins job configuration.

  1. Go to your Jenkins job configuration page by clicking on the job name from the Jenkins dashboard.
  2. Scroll down to the "Branches to build" section.
  3. In the "Branch Specifier" field, add a regular expression match that excludes the branch you want to skip the build for.

For example, if you want to skip builds for a branch named "skip-build", you can add the following regular expression match:

^(?!skip-build).*$ 

This regular expression will match all branch names except for "skip-build".

  1. Save the Jenkins job configuration changes.

Jenkins will now skip initiating a pull request build for the specified branch.