This guide shows how to integrate GitHub with Slack for better team visibility and faster response times.

Why Integrate?

Benefits:

  • Real-time notifications of PRs, reviews, and merges
  • Faster review times (team sees PRs immediately)
  • Better awareness of what’s being deployed
  • Centralized communication (no need to check GitHub constantly)
  • Build and deployment status in Slack

Prerequisites

  • Slack workspace admin access (or ability to request app installation)
  • GitHub repository admin access
  • Slack channels created: #dev-team, #deployments, #alerts

Installation

Step 1: Install GitHub App in Slack

  1. Open Slack and go to your workspace

  2. Add GitHub app:

    • Click workspace name → Settings & administration → Manage apps
    • Search for “GitHub”
    • Click “Add to Slack”

    Or visit: https://slack.com/apps/A01BP7R4KNY-github

  3. Authenticate:

    • Click “Add GitHub to Slack”
    • Sign in to GitHub if prompted
    • Authorize the Slack app
  4. Verify installation:

    • Type /github in any Slack channel
    • You should see GitHub slash command options

Step 2: Subscribe Channels to Repositories

Subscribe #dev-team to Pull Requests

  /github subscribe owner/repo-name pulls reviews comments
  

What this does:

  • pulls - New PRs opened, closed, merged
  • reviews - PR reviews submitted, approved, changes requested
  • comments - Comments added to PRs

Example:

  /github subscribe yourcompany/yourapp pulls reviews comments
  

Subscribe #deployments to Releases

  /github subscribe owner/repo-name deployments releases
  

What this does:

  • deployments - Deployment started, succeeded, failed
  • releases - New releases published

Subscribe #alerts to Build Status

  /github subscribe owner/repo-name statuses
  

What this does:

  • statuses - CI/CD build status (GitHub Actions)
  • Notifies on failures immediately

Step 3: Configure Notification Preferences

For #dev-team (all PR activity):

  /github subscribe owner/repo-name pulls reviews comments
  

Optional filters (reduce noise):

  # Only notify for PRs to main branch
/github subscribe owner/repo-name pulls:* --filter "base:main"

# Only notify for reviews on open PRs
/github subscribe owner/repo-name reviews:* --filter "state:open"
  

For #deployments (just deployments):

  /github subscribe owner/repo-name deployments
  

For #alerts (failures only):

  /github subscribe owner/repo-name statuses --filter "event:failure"
  

Notification Examples

Pull Request Opened

  🆕 Pull Request Opened
#247 Add webhook subscription functionality
by @john-doe • yourcompany/yourapp

[View Pull Request]
  

Pull Request Reviewed

  ✅ Pull Request Approved
#247 Add webhook subscription functionality
Reviewed by @jane-doe

[View Pull Request]
  

Pull Request Merged

  ✅ Pull Request Merged
#247 Add webhook subscription functionality
Merged by @john-doe into main

[View Pull Request]
  

Build Failed

  ❌ Build Failed
yourcompany/yourapp • main branch
Tests failed on commit abc1234

[View Build] [View Logs]
  

Deployment Succeeded

  🚀 Deployed to Production
yourcompany/yourapp • main branch
Commit: abc1234 - feat(webhooks): add subscription endpoints

[View Deployment]
  

Useful Commands

Subscribe to Repository

  /github subscribe owner/repo-name [features]
  

Features:

  • issues - New issues, closed issues, issue comments
  • pulls - PR opened, closed, merged
  • reviews - PR reviews
  • comments - PR and issue comments
  • commits - New commits (warning: very noisy)
  • releases - New releases published
  • deployments - Deployment status
  • statuses - CI/CD status (GitHub Actions, builds)
  • public - Repository made public
  • branches - Branch created/deleted

Unsubscribe from Features

  /github unsubscribe owner/repo-name [features]
  

Example:

  # Too many commit notifications, remove them
/github unsubscribe yourcompany/yourapp commits
  

List Subscriptions

  /github subscribe list
  

Shows all repositories this channel is subscribed to and which features.

Filters

  /github subscribe owner/repo-name [features] --filter "[conditions]"
  

Common filters:

  # Only PRs to main branch
--filter "base:main"

# Only open PRs
--filter "state:open"

# Only failures
--filter "event:failure"

# PRs from specific author
--filter "author:username"

# PRs with specific label
--filter "label:priority"
  

#dev-team

Purpose: Day-to-day development activity

Subscriptions:

  /github subscribe yourcompany/yourapp pulls reviews comments
  

Who should join: All developers

Notifications:

  • PR opened → Developers can review
  • PR reviewed → Author knows to address feedback
  • PR merged → Team knows what’s deployed

#deployments

Purpose: Deployment and release tracking

Subscriptions:

  /github subscribe yourcompany/yourapp deployments releases
  

Who should join: All team members (devs, PM, stakeholders)

Notifications:

  • Deployment started → Team knows deploy in progress
  • Deployment succeeded → Feature is live
  • Deployment failed → Team can react quickly

#alerts

Purpose: Critical issues requiring immediate attention

Subscriptions:

  /github subscribe yourcompany/yourapp statuses --filter "event:failure"
  

Who should join: On-call developers, tech lead

Notifications:

  • Build failed → Fix immediately
  • Tests failed → Investigate
  • Security scan failed → Address vulnerability

Best Practices

✅ Do

  • Subscribe #dev-team to PR activity - Everyone sees what’s being worked on
  • Use separate channels - Keep deployments separate from development chatter
  • Filter notifications - Use filters to reduce noise
  • Encourage reactions - Use 👀 when reviewing, ✅ when approved
  • Turn off notifications for commits - Too noisy, use PRs instead

❌ Don’t

  • Subscribe to too many features - Notification fatigue is real
  • Put everything in one channel - Separate by concern
  • Subscribe personal DMs - Use channels for team visibility
  • Ignore notifications - If channel is too noisy, adjust subscriptions

Troubleshooting

Issue: Not Receiving Notifications

Check:

  1. Is channel subscribed?

      /github subscribe list
      
  2. Is GitHub app installed in workspace?

    • Workspace settings → Apps → Search “GitHub”
  3. Does your account have repo access?

    • GitHub → Settings → Applications → Slack
  4. Are notifications filtered out?

    • Check filter settings

Issue: Too Many Notifications

Solution:

  # Unsubscribe from noisy features
/github unsubscribe yourcompany/yourapp commits

# Add filters
/github subscribe yourcompany/yourapp pulls --filter "base:main"
  

Issue: Wrong Channel Getting Notifications

Solution:

  # In wrong channel, unsubscribe
/github unsubscribe yourcompany/yourapp

# In correct channel, subscribe
/github subscribe yourcompany/yourapp pulls reviews
  

Advanced: Custom Workflows

Notify Specific People for PRs

Use GitHub CODEOWNERS file:

  # .github/CODEOWNERS
/app/api/         @backend-team
/frontend/        @frontend-team
/docs/            @tech-writer
  

When PR touches these files, those teams are automatically requested for review.

Auto-Close Stale PRs

GitHub Action + Slack notification:

  # .github/workflows/stale.yml
name: Close stale PRs

on:
  schedule:
    - cron: '0 0 * * *'

jobs:
  stale:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/stale@v8
        with:
          days-before-stale: 30
          days-before-close: 7
          stale-pr-label: 'stale'
          stale-pr-message: 'This PR has been inactive for 30 days. Closing in 7 days.'
  

Slack integration will notify in #dev-team when PR is marked stale.


Integration with Other Tools

Postman Bot

See api-testing.md for integrating Postman test results in Slack.

Deployment Notifications

If using Railway:

  • Railway can post deployment notifications to Slack
  • Configure in Railway dashboard → Integrations → Slack

If using GitHub Actions:

  # .github/workflows/deploy.yml
- name: Notify Slack
  uses: slackapi/slack-github-action@v1
  with:
    payload: |
      {
        "text": "🚀 Deployed to production",
        "blocks": [
          {
            "type": "section",
            "text": {
              "type": "mrkdwn",
              "text": "Deployment successful: ${{ github.sha }}"
            }
          }
        ]
      }
  env:
    SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
  

Maintaining Integration

Regular Reviews

Monthly:

  • Review which channels are subscribed
  • Check if subscriptions are still relevant
  • Adjust filters based on noise levels

When team changes:

  • Add new developers to #dev-team
  • Update CODEOWNERS file
  • Review who gets @ mentions

Documentation

Keep this guide updated when:

  • Adding new repositories
  • Changing notification preferences
  • Creating new Slack channels

Quick Reference

  # Subscribe to PR activity
/github subscribe owner/repo pulls reviews comments

# Subscribe to deployments
/github subscribe owner/repo deployments

# Subscribe to build failures
/github subscribe owner/repo statuses --filter "event:failure"

# List subscriptions
/github subscribe list

# Unsubscribe
/github unsubscribe owner/repo [features]

# Help
/github help
  

Next Steps