Skip to content

Jenkins plugin for ignoring GitHub pull requests based on PR title.

License

Notifications You must be signed in to change notification settings

anyTV/jenkins-github-skip-pr-by-title-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub Skip PR by Title Plugin

Jenkins plugin for ignoring GitHub pull requests based on PR title.

Getting Started

Prerequisites

See Jenkins Plugin Tutorial for more information

  1. Install Maven 3 and JDK 8.0 or later.
  2. Add the following XML to your ~/.m2/settings.xml (Windows users will find them in %USERPROFILE%\.m2\settings.xml). Create the file if it does not exist.
<settings>
  <pluginGroups>
    <pluginGroup>org.jenkins-ci.tools</pluginGroup>
  </pluginGroups>

  <profiles>
    <!-- Give access to Jenkins plugins -->
    <profile>
      <id>jenkins</id>
      <activation>
        <activeByDefault>true</activeByDefault>
      </activation>
      <repositories>
        <repository>
          <id>repo.jenkins-ci.org</id>
          <url>https://repo.jenkins-ci.org/public/</url>
        </repository>
      </repositories>
      <pluginRepositories>
        <pluginRepository>
          <id>repo.jenkins-ci.org</id>
          <url>https://repo.jenkins-ci.org/public/</url>
        </pluginRepository>
      </pluginRepositories>
    </profile>
  </profiles>
  <mirrors>
    <mirror>
      <id>repo.jenkins-ci.org</id>
      <url>https://repo.jenkins-ci.org/public/</url>
      <mirrorOf>m.g.o-public</mirrorOf>
    </mirror>
  </mirrors>
</settings>

Building

Download the files or clone this repository on your machine. Open the directory of the files on your terminal. Run mvn package on the terminal, and github-skip-pr-by-title.hpi will be created inside the target/ directory.

Installation

To install the plugin:

  1. Navigate to the Manage Jenkins > Manage Plugins page in the web UI.
  2. Click on the Advanced tab.
  3. Choose github-skip-pr-by-title.hpi under the Upload Plugin section.
  4. Upload the plugin file

Once a plugin file has been uploaded, the Jenkins master must be manually restarted in order for the changes to take effect.

See Managing Plugins for more information.

Usage

When configuring a GitHub Organization Folder or a Multibranch Pipeline item with GitHub branch source, you may add the behavior called "Pull request title filtering behaviour". This behavior does not have any parameter.

Once added, all scanned pull requests with either [ci skip], [skip ci], or [wip] anywhere on the PR title (case insensitive) will be ignored. Separator between the words "ci" and "skip" on the former two can either be a dash, an underscore, or a single space.

This plugin works best with these settings for branch discovery:

  • Discover branches > Strategy: Exclude branches that are also filed as PRs
  • Filter by name (with wildcards) > Include: "master PR-*"

Running the tests

Open the directory of the files on your terminal then run mvn test.

Debugging

Open the directory of the files on your terminal then run the following:

mvn hpi:run 

You can open Jenkins web UI at http://localhost:8080/jenkins once "Jenkins is fully up and running" is logged on the terminal. The Jenkins instance will have the plugin installed by default.

If you want to run it on a specific port, run the following instead:

mvn hpi:run -Djetty.port=<PORT>

Built With

  • Maven - Dependency Management

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

About

Jenkins plugin for ignoring GitHub pull requests based on PR title.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published