Slack Github Subscribe



March 6th, 2015

  1. Slack Subscribe To Github
  2. Slack Github Subscribers
Github

Slack Subscribe To Github

The Github integration for Slack is great for team productivity. Having the ability to give Slack channels full visibility into Github projects, for real-time notifications, is an amazing way to keep the development team on the same page.

If you are using Slack(Yes it’s awesome) and Github Enterprise(Awesome too), then you might have played around with the integration of both the tools.

  1. Slack チャンネルでリポジトリを購読 /github subscribe your-org/your-repo 成功したら Subscribed #github to your-org/your-repo と表示される デフォルトオフの項目も購読させる: /github subscribe webdino/xxxxx reviews comments branches commits:all.
  2. I run /github subscribe dabapps/ and then run /github subscribe list and it's there, but then 10 minutes later I run /github subscribe list again and it's gone. Not sure where to start with debugging this. I'm not even sure if it's a Github or Slack problem.
  3. Simply subscribe to the RSS feed of the github page you wish to be notified of with the Slack RSS feed app.

The Slack documentation helps a bit but to have a complete integration with issues, issues comments etc, you’ll have to jump through some hoops. So let me put it all below.

Adding Webhook in Github Enterprise for your Slack group/channel

First step is to obviously add a hook in your company’s Github Enterprise repo for Slack. Skip to next section if you’ve already addded the Github Webhook.

  1. Click on the Add Service Integration menu link for your group

  2. Select your Slack group or channel where you want the Github notifications:

  3. Now click on the switch to unauthed mode

  4. Copy the Webhook URL you see on the next screen. Now goto the Settings > Hooks page of your repo in Github Enterprise. Add a Webhook and paste the Webhook URL there.

After adding the Webhook you should receive notifications when anyone pushes commits to your repo.

Updating Webhook in Github Enterprise to support more notifications

Now you may have noticed that even after adding a Webhook, you can only see notifications for new commits. The integration is still missing notifications for events such a new issue or issue comment etc.

The reason is that Webhook only publishes commit events by default. You can change this behaviour by altering the hook via Github Webhook API

Assuming your Github Enterprise link as http://githuben.mycompany.com/, your organization as myorg and repo as myrepo

1 . Find your hook url (containing the hook id) by retrieving a list all the hooks for a repo:

You should see a big JSON output. All you need is the url of the hook matching your Slack Webhook integration url.

You can see in the JSON aboce, that events in the hook is only push. The url for our Slack hook is - http://githuben.mycompany.com/api/v3/repos/myorg/myrepo/hooks/1121

2 . Now add all the extra notifications to the events for the Webhook using the hook url from above:

That’s all. You should now be able to receive notifications for all these events apart from push. You can call the Get Hooks api again to confirm.

Slack Github Subscribers

Please enable JavaScript to view the comments powered by Disqus.blog comments powered by Disqus