GitHub Board Slack Notifications

Vlad Goran
IDAGIO
Published in
6 min readNov 10, 2020

Part 1/3: “How hard can it be?”

An example of a notification from the integration

TL;DR; If you want it for your own org…

  1. Make sure you have a AWS account
  2. Make sure you have the serverless cli (sls) installed and configured with said AWS account (works with free accounts)
  3. Make sure you have a Slack application setup
  4. Go to this repo, clone it, configure it, deploy it; README.md for details

A little bit of background

GitHub Boards

We had to do a bit of restructuring at IDAGIO which left us with a smaller product team. As a result we wanted to streamline our processes by getting our production and project management efforts onto GitHub. Having code and product specs all in one place means we can link specs to pull-requests, see updates, etc. all from the comfort of GitHub.

To keep the status of tickets in check and be transparent with everyone we decided to use GitHub Boards. It’s basically Trello Boards, aka Kanban but on Github. Some fancy automation for pull-requests and such but basically just columns to which you can add tickets and notes; then drag them around as necessary.

GitHub’s public roadmap Project Board — see it live

Same, but for multiple repos…

When this feature was first introduced it was limited to having (multiple) projects per repository. This proved to be quite a limitation for teams working with multiple repositories. In this case you usually need one central board to plan your work. Some examples from inside IDAGIO include…

1. the web team manage: the web-app and the landing pages

2. the backend team is using micro-services which means their work spans across quite a few repos

3. our latest example: keeping track of projects that span multiple teams from the product level

Hence GitHub later introduced Organization-wide project boards which are Boards you can setup in your Org. Settings tab and that can link to specific repositories, thus showing issues & PRs from different repositories all in one project board. Bliss.✨

In the Web team we’ve used them to plan our work since they were introduced and it was great! But something is missing…

Slack Notifications

Like most teams we have a per-team #notifications channel on Slack where we see status updates relevant to the team: opened tickets & pull requests, CI updates, external tooling results, etc.

An example of a notification from the #webtop-notification

Since we were going to scale up our usage of GitHub Boards and especially our usage of Organization Wide GitHub boards so it felt necessary that we have visibility on changes right inside Slack like we have it with our channels. And here’s where the story starts…

How hard can it be?

Well this feature is quite old by now, there must be solutions for it…

One. No help from the official integration ☹️

First thought was Slack’s GitHub bot must have support for this. Here’s the repo for GitHub’s official slack integration: https://github.com/integrations/slack

No mention of project boards at all…

Ok, ok, maybe it’s not in the docs. Let’s have a look at the issues.

Hey there, thanks for this integration!

Are any plans to support subscribing to changes in GitHub Projects (the Kanban feature), and what kind of timeline we’re looking at?

We use projects to streamline the PR review process and it would be nice to ping changes in review status to Slack.

nomeyer commented on 26 Sep 2018

With 17 likes and 2 years old. Not encouraging. The reply:

Thanks for opening this issue! The team at GitHub is not actively working on new features for the GitHub + Slack integration. We will still be deploying security/bug fixes and reviewing community contributions. If you would like to help implement an improvement, read more about contributing and consider submitting a pull request.

Alrighty. Let’s try something else…

Two. GitHub Actions: closer but no cigar 🙅‍♂️

GitHub lately has been trying to break into the CI world with a new features called GitHub Actions which basically gives you hooks on different git / GitHub events to perform actions on. It’s super slick and while researching I found this: Slack Project Notifier

See it here

How cool! Let’s try it! Erm, no. Not just yet

GitHub Actions workflows can’t be executed on this repository. GitHub Actions is not available for private repositories on le
You need the latest plans to get GitHub Actions working

Then I remembered we had tried to get this feature before (in January) and the pricing for it was 3x our costs. But we looked again and found out actually GitHub got it’s pricing act together and now we could get…

3,000 minutes for GitHub Actions for an extra 12$ / month

SOLD! 💰

We upgraded and spoiler alert… It didn’t help 💸

But back to this. How to install a github action? Easy peasy!

1. Create a directory structure `.github/workflows` and add a `.yml` file in it
2. Drop this stuff inside as per the instructions.
3. You will be able to see it running in your Actions Tab

However, first you need to setup the secrets.

Setup up your secrets in the Settings

1. SLACK_WEBHOOK_URL — this you get from Slack when you setup an application with webhooks

2. TOKEN — a GitHub token for the notification to get more info, I setup a personal github token for it

3. PROJECT — optional, the URL of the github board as reported by the GitHub API

Ok I installed it, it runs; but it doesn’t help with the bigger issue!

It will only emit notifications for boards on the same repo as the action. The hooks that it subscribes to are only local to the repository. I asked the GitHub Community about it here and they’re like nah… 🙅‍♂️

However while setting up the Slack integration i found that it’s actually quite easy to generate a slack notification, they even give you a curl:

$ curl -X POST -H 'Content-type: application/json' - data '{"text":"Hello, World!"}' https://hooks.slack.com/services/<SECRET STUFF>

and you get…

Felt like progress!

Next…

Three. Ok, but what IFTTT? 🤔

“If This Then That” has a GitHub integration. It’s super limited, doesn’t know about project boards at all. Next!

Four. Heavy guns 🔫

Ok, so i did once build a GitHub bot with the Probot framework but it required a running instance on Heroku. That felt like a lot of overhead basically for forwarding a transformed message from GitHub to Slack.

So uhm, yeah stateless, transformation… Lambda function? 🤷‍♀️

This was my message to a colleague:

Guess which option we’re going with? That’s right it’s gonna’ be number 4!
Not great at spelling “lambda” yet 💃

End of Part 1

Continued in Part 2 or “How I learned to spell Lambda”

Learnings from Part 1:

  1. The official GH-Slack integration doesn’t know about Project Boards and doesn’t plan to add support for it
  2. It’s important that GitHub Actions only run per repo since they are useless for Organisational Boards
  3. IFTTT has no clue about GitHub Boards

Thanks for reading so far 🙇‍♂️

--

--