Recipe 1.1 Integrate Slack with a GitHub repository
Problem
You wish to post notifications from a specific GitHub repository to a Slack channel.
Solution
- Visit GitHub in Slack’s App Directory.
- Click Install.
- Select a channel where GitHub events will be posted.
- Click Add GitHub Integration.
- Click Authenticate your GitHub account.
- Choose the repositories you’d like Slack notifications for.
- Choose the GitHub events you want to post to Slack.
- You can customise the display name for GitHub posts and even add a custom icon.
- When you’re done, click “Save Integration”.
Discussion
Slack will ask for permission to access some GitHub repositories the first time you connect the app. We’ll need read and write access to all public and private repo data: code, issues, pull requests, wikis, settings, webhooks and services, and deploy keys.
The only way Slack can access the full list of your public and private repos is with GitHub’s “repo” scope, which also provides all of the permissions listed above.