Three weeks ago, I randomly got an issue on my latest GitHub repo. A few days later, I got another one. I felt like I wanted a way to know about issues, PRs, or any other repo activity as soon as it comes in. So, I thought to automate it with Slack.
My first thought was to use a GitHub Action. So, I spent a few hours tinkering with a GitHub Action on a test repo to check if it works. In the end, I arrived at a result that worked decently. Although, workflow execution logs are public, allowing anyone to see who and what triggered it.
Why is that a problem?
Because, if a user stars and unstars the repo, it would be visible in the logs. Same for if a user watches and unwatches the repo.
So, that never made it to the final repo.
Then, I told ChatGPT (funny, considering the repo) about the issue and it suggested platforms like Zapier. So, I signed up for a Zapier account, oAuth’d into Slack and GitHub, and set up my Zap. I wouldn’t get notifications for every star, but that’s a small compromise.
The only problem the Free plan offers 100 — in this case, uncontrollable — Zap executions per month. That means, at any point, Slack notifications for that month will just stop.
So, I didn’t go the Zapier route.
GitHub integration for Slack⌗
I was looking for a solution and found a GitHub repo
integrations/slack. This was a repo by GitHub about their integration for Slack.
Adding it is simple:
- Visit slack.github.com
Add to Slack
- Add the integration to your workspace, and then add it to a channel
- Use this command:
/subscribe [repo] [optional additional events to subscribe to]
So, I added the integration, subscribed to the repo (linking it to the channel).
When I made a commit, I get a notification like this:
A few days later, as I switched my phone on, I got a Slack notification.
So, I replied to the message using Slack itself.
(I later moved to Discord, with their tailor-made webhook integration for GitHub which provides me more data than the Slack integration did)
SubscribeAside from repos, you can even monitor this blog!
Subscribe using RSS!