A GitHub App built with Probot that A PR labeler GitHub App built with Probot.
Operation of the GitHub app depends on the presence of a configuration file named labelbot.yml. It must be located in the .github directory of the repository. If the file does not exist in the repository, it will also look in the organizations' .github repo.
The configuration file provides multiple methodologies for auto-labeling. Labels can be applied based off of the target (base) branch name, the source (head) branch name, and/or the set of files modified in the PR.
The format of the file is as following:
sourceBranchLabels:
labelA: RegEx
labelB: RegEx
targetBranchLabels:
labelC: RegEx
...
pathLabels:
labelD: [filepattern1, filepattern2]
labelE: [filepattern3, filepattern4]For example:
sourceBranchLabels:
hotfix: 'hotfix-.*'
bug: 'bugfix-.*'
targetBranchLabels:
release: 'release-.*'
trunk: '(master|develop)'
pathLabels:
docs: ['*.md', 'docs/*'],
config: ['*.yml']The above configuration would:
- apply a
hotfixlabel to any PR coming from a branch name starting withhotfix- - apply a
bugfixlabel to any PR coming from a branch name starting withbugfix- - apply a
releaselabel to any PR being merged to a branch starting withrelease- - apply a
trunkbranch to any PR to develop or master branches - apply a
docslabel if the PR touches a markdown file or any file in the docs directory - apply a
configlabel if the PR touches any yml file
# Install dependencies
npm install
# Run with hot reload
npm run build:watch
# Compile and run
npm run build
npm run startIf you have suggestions for how gh-label-bot-ts could be improved, or want to report a bug, open an issue! We'd love all and any contributions.
For more, check out the Contributing Guide.
ISC © 2020 John Hancock jhancock93@users.noreply.github.com