Label It
A command line tool for adding labels to Github pull requests using a declarative YAML configuration. Written in Go. Available for Mac, Linux, and Windows. Latest release can be found here. Documentations can be found on the project page in Github.
Automatically add labels based on the following rules:
- Branch names: both base and head branch.
- Files changed.
- Pull request number, title text and body text.
- User who created the pull request.
- Time since the pull request was created and last updated.
Rules allow you to declare if and when a label should be applied. They are written via a descriptive YAML configuration.
rules:
# If the base branch is "master" the label "MyLabel"
# will be added to the pull request.
- label: MyLabel
base-rule:
exact: master
You can use rules to perform a simple check, like verifying a branch name. Or you can use them to create complex configuration, powered by regular expressions, to check for file names, text content, and more.
file-rule:
# "exact" checks for this exact file name
exact: /docs/readme.md
# "match" check all files using the provided regex pattern
match: (.md)$
Label-it is written in Go and takes advantage of goroutines for parsing rules, and communicating with the Github API. The concurrent architecture offers a highly optimized algorithm that can easily handle large pull requests and complex rules.
The project is fully open source and implements a GPL-3.0 License. You can build the project from source using the provided Makefile.