- heroku
- heroku cli
-
Heroku login
$ heroku login Please type your e-mail address and passward $ heroku plugins:install heroku-config
-
Clone this project
$ go get github.com/kutsuzawa/slackbot $ cd ${GOPATH}/src/github.com/kutsuzawa/slackbot
-
Prepare .env
$ cp .env.sample .env $ vim .env Please edit slack webhook and channel name. Opptional) Please add GithubName=SlackName for mention function in slack.
More detail in https://slack.com/services/new/incoming-webhook
-
Create Heroku App
$ heroku create $ git push heroku master $ heroku config:push (This command push .env to heroku app)
You can get your app's URL.
-
Setting Webhook in GitHub
- https://github.com//slackbot/settings/hooks
- Put "Add webhook" button
- Input your app's URL to "Payload URL"
- Content type is "application/json"
- Choise "Let me select individual events"
- Check "Pull requests" only.
Your PR information send to slack !!
-
Opptional) Add a Slash Command
- https://api.slack.com/apps
- Put "Create New App"
- Fill web form
- "Features" > "Slash Commands" in the left navigation bar
- Put "Create New Command"
- Command is "/useradd"
- Request URL is "/commands"
- Usage Hint is @
- Put "Save"
Install your slack app. In the your talkroom, Please input reviewer's information.
/useradd <GitHub Name> @<Slack Name
. You can send notification to reviewer in next your pull request.