A Probot bot to make sure that a given label is added to specific issues and pull requests when all other labels do not match a regex.
Add a .github/relabel.yml
file to your repository and then run the bot against it.
If the config is empty or doesn't exist, the bot will not run.
# This example configuration will add the `needs-area` and `needs-type` labels
# to any new issue and pull request that do not have labels matching `area:.*` or `type:.*`.
# Once the issue or the pull request has the `area:.....` label added the `needs-area` label will be
# removed from the issue or pull request.
issues:
# The missing label which will be added to issues if the regex doesn't match any other labels
- missingLabel: needs-area
regex: area:.*
- missingLabel: needs-type
regex: type:.*
pulls:
# The missing label which will be added to pull requests if the regex doesn't match any other labels
- missingLabel: needs-area
regex: area:.*
- missingLabel: needs-type
regex: type:.*
Previous version of the bot will still work with current version, as the schema for the configuration file does not change the structure. So it's possible to upgrade and keep old configuration:
# The old format matches the new one, using a different name
requiredLabels:
- missingLabel: needs-area
regex: area:.*
- missingLabel: needs-type
regex: type:.*
If you have suggestions for how this bot could be improved, or want to report a bug, open an issue! We'd love all and any contributions.