How to Setup Slack and Drone Slack Blame
Create a app: https://api.slack.com/apps?new_app=1
Add features and functionality
Edit App display name
Go to OAuth & Permission, then edit the scope of bots:
What I need is to make Drone (drone-slack-blame) to notify the users with the build status, and send messages to channels as well, so I need
users:readpermission to map Github users and Slack users (you can set
mappingin drone-slack-blame section in drone.yml), and Drone Bot requires
chat:writeto send private messages, and
chat:write:publicto send messages to public channels.
Install App to workspace
then you should see
Bot User OAuth Access Tokenis present.
Now you can use the token in Drone, here is the example of my drone setting:
Remember to set user mappings, first argument is your GitHub name, and the second one is Slack display name. You can check more in the source code.
How it works?
The image below is for private messages:
And it sends message to a public channel as well:
Last but not least, you can check https://api.slack.com/apps/ to configure your Slack app, I have to say that Slack administration pages are like a huge maze… it always takes me some time to find out what I want.