CodingBowl

Slack & GitHub Integration: Get Commit Notifications for Specific Branches

Published on 3 Jun 2025DevOps
image
Photo by Growtika on Unsplash

This guide provides a straightforward process to install the GitHub app on your Slack workspace and configure it to receive real-time commit notifications for a specified branch of your GitHub repository. Stay updated on your team's development progress directly within your Slack channels.


Part 1: Install the GitHub App on Slack

  1. Go to the GitHub Slack Integration Page: Open your web browser and navigate to https://slack.github.com/.
  2. Add to Slack: Click on the "Add to Slack" button.
  3. Authorize Slack: You'll be prompted to sign in to your Slack workspace and authorize the GitHub app to access it. Select the workspace where you want to add the integration and click "Authorize."
  4. Connect GitHub Account: After authorizing Slack, you'll need to connect your GitHub account. Click "Connect GitHub account" and log in with your GitHub credentials.
  5. Grant Permissions: Review the permissions the app requests (e.g., access to repositories, commit data, webhook events) and grant permission. It's recommended to share only the necessary information for security.
  6. Configure in Slack: Once the app is installed, the GitHub app will send you a direct message in Slack with instructions on how to use the /github slash command.

Part 2: Subscribe to a Specified Branch for Commit Notifications

  1. Go to the Desired Slack Channel: Open Slack and navigate to the channel where you want to receive GitHub commit notifications.
  2. Subscribe to the Repository: In the Slack channel, type the following command to subscribe to a repository:
    /github subscribe username/reponame
    Replace username with the GitHub username or organization name and reponame with the name of the repository. For example: /github subscribe my-org/my-repo.

    By default, this will subscribe you to notifications for issues, pull requests, commits on the default branch (usually main), releases, and deployments.

  3. Subscribe to Commits on a Specific Branch: To get commit notifications for a specified branch (not just the default branch), use the following command:
    /github subscribe username/reponame commits:branch_name
    Replace username/reponame with your repository details and branch_name with the specific branch you want to monitor. For example: /github subscribe my-org/my-repo commits:develop.
    • To subscribe to all commits across all branches, you can use: /github subscribe username/reponame commits:*

Important Notes:

  • Ensure you have the necessary permissions in both GitHub and Slack to perform these actions (e.g., administrator or owner roles).
  • You can customize notifications further using the /github settings command, which allows you to enable or disable specific event types (e.g., reviews, comments, branches).
  • If you encounter issues, review your Slack logs or reauthorize GitHub access.

Meow! AI Assistance Note

This post was created with the assistance of Gemini AI and ChatGPT.
It is shared for informational purposes only and is not intended to mislead, cause harm, or misrepresent facts. While efforts have been made to ensure accuracy, readers are encouraged to verify information independently. Portions of the content may not be entirely original.

image
Photo by Yibo Wei on Unsplash