# @ericlai616/reviewer-assignment-bot

> A Node.js server which automatically requests for reviews when a specific label is added to a pull request. Currently only deal with users, but not teams.

Latest version **0.0.5** (published 2020-04-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ericlai616/reviewer-assignment-bot
pnpm add @ericlai616/reviewer-assignment-bot
yarn add @ericlai616/reviewer-assignment-bot
bun add @ericlai616/reviewer-assignment-bot
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2020-04-08 |
| First published | 2020-03-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 8 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 (+4 in 4 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Eric Lai |
| Maintainers | ericlai616 |

## Links

- npm: https://www.npmjs.com/package/@ericlai616/reviewer-assignment-bot
- Repository: https://github.com/ericlai616/reviewer-assignment-bot
- Homepage: https://github.com/ericlai616/reviewer-assignment-bot#readme
- Issues: https://github.com/ericlai616/reviewer-assignment-bot/issues
- npm.io page: https://npm.io/package/@ericlai616/reviewer-assignment-bot

## Dependencies (8)

- [fs](https://npm.io/package/fs.md) 0.0.1-security
- [config](https://npm.io/package/config.md) ^3.2.0
- [log4js](https://npm.io/package/log4js.md) ^4.5.1
- [express](https://npm.io/package/express.md) ^4.17.1
- [shuffle-array](https://npm.io/package/shuffle-array.md) ^1.0.1
- [@octokit/request](https://npm.io/package/@octokit/request.md) ^5.0.1
- [@octokit/auth-app](https://npm.io/package/@octokit/auth-app.md) ^2.4.3
- [@octokit/webhooks](https://npm.io/package/@octokit/webhooks.md) ^7.1.0

## Recent versions

- 0.0.5 (latest) — 2020-04-08
- 0.0.4 — 2020-03-22
- 0.0.3 — 2020-03-02
- 0.0.2-test-npx — 2020-03-02
- 0.0.2 — 2020-03-02

## README

# reviewer-assignment-bot

A Node.js server which automatically requests for reviews when a specific label is added to a pull request.
Currently only deal with users, but not teams.

## Configuration
Uses config module with default file `config/default.json`.

### Config values
`app`: Basic configuration of GitHub App

Config | Description
----- | -----
id | ID of GitHub App
private-key-path | The file containing the private key generated from GitHub App. Default: `private-key.pem`
secret | The secret of the GitHub App webhook
base-url | The base URL of GitHub REST API for GitHub Enterprise support. Default: `https://github.com/api/v3`

`log`: A configuration object for log4js. Default configuration will be the same as log4js.

`labels`: Key-value pairs for configuration of triggering auto review request(s)
The key name is the name of the trigger label to be configured.
The value has the following schema:

Config | Description
----- | -----
reviewers | An array of GitHub logins of the reviewers
number-of-reviewers | (Optional) An integer stating the number of review request to be sent. By default, all reviewers will be included

Example:
```json
{
  "app" : {
    "id": 0,
    "private-key-path": "private-key.pem",
    "secret": "foobar",
    "base-url": "https://github.com/api/v3"
  },
  "log": {
    "appenders": {
      "console": {
        "type": "console"
      }
    },
    "categories": {
      "default": {
        "appenders": [ "console" ],
        "level": "info"
      }
    }
  },
  "labels": {
    "Please REVIEW!!": {
      "reviewers": ["reviewer1", "reviewer2"]
    },
    "More REVIEW needed": {
      "reviewers": ["reviewer3", "reviewer4", "reviewer5"],
      "number-of-reviewers": 2
    }
  }
}
```

## Docker

1. Create `config/default.json` and configure values as described above
2. Build a docker image
```sh
docker build -t reviewer-assignment-bot .
```
3. Run the image in a detached container with a port binded to container port 3000
```sh
docker run -p ${port}:3000 -d reviewer-assignment-bot
```
4. If a console logger is configured, log can be viewed by using docker log
```sh
docker logs ${containerId}
```

---
_Source: https://npm.io/package/@ericlai616/reviewer-assignment-bot · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
