Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/openclassrooms/slack-pull-request-notifier
Slackbot written in Node.js that posts channel notifications to ping people when they are added as reviewers to a pull request, when changes are requested, and when those changes are approved.
https://github.com/openclassrooms/slack-pull-request-notifier
Last synced: about 1 month ago
JSON representation
Slackbot written in Node.js that posts channel notifications to ping people when they are added as reviewers to a pull request, when changes are requested, and when those changes are approved.
- Host: GitHub
- URL: https://github.com/openclassrooms/slack-pull-request-notifier
- Owner: OpenClassrooms
- Created: 2018-01-26T10:26:04.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2021-01-26T12:03:15.000Z (about 4 years ago)
- Last Synced: 2025-01-08T02:06:21.599Z (about 1 month ago)
- Language: JavaScript
- Homepage:
- Size: 1 MB
- Stars: 0
- Watchers: 26
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Slack pull request notifier
## What is it?
This is a Slackbot written in Node.js that posts channel notifications to ping people when they are added as reviewers to a pull request, when changes are requested, and when those changes are approved.
![Illustration image](https://github.com/OpenClassrooms/slack-pull-request-notifier/blob/master/images/github-pull-request.png "Illustration image")
## How is it used?
First, you have to create a [new Slack application](https://api.slack.com/apps), then go to `Add features and functionality > Incoming Webhooks` and click on `Add New Webhook to Workspace`.
You must properly set the following environment variables:
`PORT` - Port of the http server. (Optional) (Default port is 9321)
`SLACK_WEBHOOK` - your Slack webhook URL
Example: `https://hooks.slack.com/services/foo/bar/foobar123`
`USER_MAP` - nickname mapping from GitHub to Slack
Example:
{
"Mystraht": "john",
"Ayunn": "richard",
}
The keys (ex. "Mystraht") correspond to GitHub nicknames, and the values (ex. "John") correspond to Slack nicknames.Slack have issue with space in nickname, in this case use instead:
{
"Mystraht": "john",
"Ayunn": {
id: "SLACK_USER_ID",
name: "richard"
},
}You can then launch the Node server by running:
npm install
npm run startYou will then have to configure your GitHub webhook.
Go to your repository settings, and add a webhook with the following configuration:
Payload URL: http://:9321/github-webhook
Content type: application/json
Event: Let me select individual events.
-> Pull request
-> Pull request review comment
-> Pull request review
## RequirementThis version of Slack pull request notifier is tested with NodeJS v8 LTS.
## Contributing
Feel free to submit a pull request!