https://github.com/duck8823/danger-slack
notification to slack in Dangerfile
https://github.com/duck8823/danger-slack
danger notify-danger-reports ruby slack
Last synced: 5 months ago
JSON representation
notification to slack in Dangerfile
- Host: GitHub
- URL: https://github.com/duck8823/danger-slack
- Owner: duck8823
- License: mit
- Created: 2017-03-22T22:46:16.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-10-28T18:29:31.000Z (6 months ago)
- Last Synced: 2024-11-07T14:06:52.822Z (5 months ago)
- Topics: danger, notify-danger-reports, ruby, slack
- Language: Ruby
- Homepage:
- Size: 57.6 KB
- Stars: 11
- Watchers: 3
- Forks: 4
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-danger - danger-slack - Post a notification to slack in a Dangerfile. (Plugins / Ruby (danger))
README
# danger-slack
Notify danger reports to slack.
## slack setup
The following steps is required for using danger-slack plugin.
1. create bot in https://my.slack.com/services/new/bot
2. invite created bot user to channel in slack app`slack.api_token` or `SLACK_API_TOKEN` are the bot's token starting from `xoxb-`
## Installation
$ gem install danger-slack
## Usage
### How to set your Slack API token
In Dangerfile,
```ruby
slack.api_token = 'SLACK_API_TOKEN'
```or
Set Environment variable `SLACK_API_TOKEN`
### methods
Get channels
```ruby
slack.channels
```Get members
```ruby
slack.members
```Get groups
```ruby
slack.groups
```Notify danger reports to slack
```ruby
slack.notify(channel: '#your_channel')
```Post message to slack
```ruby
slack.notify(channel: '#your_channel', text: 'hello danger')
```