Skip to content

Add labels to Pull Requests based on count of modified lines

License

Notifications You must be signed in to change notification settings

greglockwood/sizelabeler

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Probot Size Labeler

A GitHub App built with probot that adds labels to Pull Requests based on matched conditions on the size of the PR.

Using

Configure by creating a .github/sizelabeler.yml file with a YAML file in the format of:

label:
  min: 0
  max: 50

Then add the Probot Size Labeler Bot to your repository.

For example,

xs:
  min: 0
  max: 2
sm:
  min: 3
  max: 5
md:
  min: 6
  max: 10
lg:
  min: 11
rm_code:
  min_deletions: 1
  max_additions: 0

Then if a pull request is opened that has a net size (added lines minus deleted lines) of 5, then the sm label will be added.

Supported conditions

For each label, the following properties are supported:

  • min: (number) the minimum value for the net size (additions - deletions) of the PR.
  • max: (number) the maximum value for the net size (additions - deletions) of the PR.
  • min_additions: (number) the minimum value for the number of lines added in the PR.
  • max_additions: (number) the maximum value for the number of lines added in the PR.
  • min_deletions: (number) the minimum value for the number of lines removed in the PR.
  • max_deletions: (number) the maximum value for the number of lines removed in the PR.
  • terminal: (boolean) specify as true to prevent processing any further labels.
  • or: (nested list) specify multiple conditions under which the label should be applied.
  • actions: (array) an array of actions, which can be opened, reopened or synchronize, to evaluate the other conditions of the label. If not specified, any action will do so.
Issues with Bot

If you are having issues with the GitHub app not working, please open an issue.

Setup

# Install dependencies
npm install

# Run the bot
npm start

See docs/deploy.md if you would like to run your own instance of this plugin.

About

Add labels to Pull Requests based on count of modified lines

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%