- A valid GitHub API Token with scope
repo - A valid Slack webhook URL (for development, you can use any webhook testing utility like webhook.site)
This app follows the 12factor convention and uses dotenv to load the configuration.
cp .env.sample .envto start with a template file- Set the values for
GITHUB_API_TOKENandSLACK_WEBHOOK_URL - Repos are configured with env variables starting with
REPO_name, and the content as a serialized JSON for the desired configuration for that repo.
For instance, if we want to see Rails' PRs with label actionpack we need to
set up a REPO_RAILS with the following serialized JSON content:
Example:
{
"name": "rails",
"org": "rails",
"includeLabels": [
"actionpack"
],
"excludeLabels": []
}You will find this example in the .env.sample, so you can use it as a
template to change/setup another repos. Repeat this step for every repo you
want to setup.
name: The repo name in github, thenamepart inhttps://github.com/org/nameorg: The org name in github, theorgpart inhttps://github.com/org/nameincludeLabels: filter PRs having ALL the labels specified hereexcludeLabels: filter PRs having ANY OF the labels specified here
Emojis are customized via ENV vars starting with EMOJI_. All of them have
default values specified in .env.sample. You can use one or many emojis
for each section.
EMOJI_HELLO_MESSAGEEMOJI_PR_HEADEREMOJI_REPO_HEADEREMOJI_APPROVED_REVIEWEMOJI_CHANGES_REQUESTED_REVIEWEMOJI_COMMENTED_REVIEWEMOJI_DISMISSED_REVIEWEMOJI_PENDING_REVIEW
NODE_ENVcontains the execution environment, allowed values"development","production"
QLTY is set up in this project to keep track of maintenance metrics like test coverage and code quality.
This project comes with a group of useful npm run scripts:
sendused to trigger the bot.testused to run the tests with Testy.coverageused to run the tests and generate a coverage report.lintused to run ESLint and report the offenses.lint-fixsimilar tolintbut including--fixto autocorrect the offenses.open-coverage-reportopens the coverage result of the most recent report in a browser.generate-dependencies-graphgenerates a diagram of the modules' dependencies using Madge. This is useful to constantly measuring the complexity of this project.churn-vs-complexitygives a summary of the code hotspots (more info in this blog post