2018-12-12 15:02:22 +00:00
# Description
This is a minimal REST API intended for use with a Continuous Integration system for managing comments on GitHub.
The problem this solves is posting comments in a PR from multiple builds without spamming the comment section. Instead we post just one comment with a table and continue to update it.
# Example Comment
---
2018-12-12 15:04:46 +00:00
### Jenkins Builds
2018-12-13 13:50:03 +00:00
| :grey_question: | Commit | :hash: | Finished | Duration | Platform | Result |
|-|-|-|-|-|-|-|
| | | | | | | |
| :x: | 1ds41ay | [#3 ](https://google.pl ) | 12:12:55 AM | ~12 min | `android` | [:page_facing_up: build log ](https://google.plconsoleText ) |
| :x: | 1ds41ay | [#3 ](https://google.pl ) | 12:13:18 AM | ~12 min | `android` | [:page_facing_up: build log ](https://google.plconsoleText ) |
| :heavy_check_mark: | 1ds41ay | [#3 ](https://google.pl ) | 12:13:53 AM | ~12 min | `ios` | [:package: package ](https://google.pl ) |
| :heavy_check_mark: | 1ds41ay | [#3 ](https://google.pl ) | 12:13:34 AM | ~12 min | `ios` | [:package: package ](https://google.pl ) |
| :heavy_check_mark: | 1ds41ay | [#3 ](https://google.pl ) | 12:14:44 AM | ~12 min | `ios` | [:package: package ](https://google.pl ) |
2018-12-12 15:02:22 +00:00
---
# API
It exposes just 1 call:
2018-12-13 13:50:03 +00:00
* `POST /builds/:id` - Post a comment for PR with given ID.
* `POST /builds/:id/refresh` - Update the comment for PR with given ID.
* `POST /comments` - Show currently managed comments in PRs.
2018-12-12 15:02:22 +00:00
By default it listens on `localhost:8080` .
# Configuration
There are few environment variables you can set:
* `LISTEN_PORT` - Default: `8000`
# Usage
For development use:
```
npm run start
```
For building use:
```
npm run build
```
To create the docker image use:
```
npm run image
```
To push the image use:
```
npm run push
```