git-slack-bot automatically posts your GitHub pull request messages to a Slack channel of your choosing. It listens to GitHub events via a webhook and can post new PRs, react with emojis to signify merges and approvals, and post review comments under the original Slack post in a thread.
- 🔔 Automated PR notifications - Get notified when PRs are opened, merged, or closed
- 💬 Threaded comments - PR review comments appear as threaded replies in Slack
- 😀 Emoji reactions - Visual indicators for PR approvals, merges, and closures
- 👥 Team member mapping - Maps GitHub users to Slack users for proper @mentions
- 🎯 Selective notifications - Configure which users and events to track
- 🔒 Secure webhooks - Validates GitHub webhook signatures for security
# Pull the latest image
docker pull ghcr.io/loveholidays/git-slack-bot:latest
# Run with configuration file
docker run -d \
--name git-slack-bot \
-p 8080:8080 \
-v $(pwd)/config.yaml:/app/config.yaml \
ghcr.io/loveholidays/git-slack-bot:latestversion: '3.8'
services:
git-slack-bot:
image: ghcr.io/loveholidays/git-slack-bot:latest
ports:
- "8080:8080"
volumes:
- ./config.yaml:/app/config.yaml
environment:
- CONFIG_PATH=/app/config.yaml
restart: unless-stopped- Download the latest binary for your platform from GitHub Releases
- Make it executable:
chmod +x git-slack-bot - Create your configuration file (see Configuration)
- Run:
./git-slack-bot --config config.yaml
# Clone the repository
git clone https://github.com/loveholidays/git-slack-bot.git
cd git-slack-bot
# Build the application
make build
# Run with configuration
./bin/git-slack-bot --config config.yaml- Create GitHub App: Set up a GitHub App with webhook permissions
- Create Slack App: Set up a Slack App with chat:write and reactions:write permissions
- Configure the bot: Create a
config.yamlfile (see example below) - Deploy: Use Docker or binary deployment
- Set webhook URL: Point your GitHub App webhook to your deployment
github:
token: "ghp_your_github_token_here"
secretKey: "your_webhook_secret_here"
org: "your-github-org"
team: "your-team-name"
ignoredPRUsers: ["dependabot[bot]", "renovate[bot]"]
ignoredCommentUsers: ["github-actions[bot]"]
slack:
token: "xoxb-your-slack-bot-token-here"
channelID: "C1234567890"
githubEmailToSlackEmail:
- githubEmail: "john.doe"
slackEmail: "john.doe@company.com"
- githubEmail: "jane.smith"
slackEmail: "jane.smith@company.com"
emoji:
approve: "white_check_mark"
merge: "merged"
close: "x"Before setting up git-slack-bot, you'll need:
- A GitHub App with the following permissions:
- Repository permissions:
- Pull requests: Read & Write
- Issues: Read & Write
- Metadata: Read
- Contents: Read
- Organization permissions:
- Members: Read (to access team information)
- Subscribe to events:
- Pull request
- Pull request review
- Pull request review comment
- Repository permissions:
- A Slack App with the following OAuth scopes:
chat:write- Post messages to channelschat:write.public- Post to public channels without joiningreactions:write- Add emoji reactionschannels:read- List public channels (optional, for channel name resolution)
- A publicly accessible endpoint for webhook delivery
- Docker runtime or Go environment for deployment
github:token: The security token of the github app, which will send events through a webhooksecretKey: The secret key of the github webhook to verify incoming events againstorg: The github organization the team is inteam: The team which has the members to post PR forignoredPRUsers: Users in the github team to ignore opened PRs for. Their comments will still show up in threads.ignoredCommentUsers: Users to ignore PR comments from. Recommended to add any automated github app account
slack:token: The security token of the slack app, which will send messages to a slack channelchannelID: The slack channel id to post the PR messages togithubEmailToSlackEmail: Mapping between github and slack users. Needed to be able to use@mentions for the correct user. Any missing users will be posted with their github user names into the slack channelgithubEmail: The github USERNAME of a team memberslackEmail: The slack email of the same team member
emoji:approve: The emoji to use as a reaction when a PR is approvedmerge: The emoji to use as a reaction when a PR is mergedclose: The emoji to use as a reaction when a PR is closed
-
Set your webhook URL in your GitHub App settings:
https://your-domain.com/webhook -
Configure webhook events to send:
- Pull requests
- Pull request reviews
- Pull request review comments
-
Set webhook secret (must match
secretKeyin config)
You can also configure the bot using environment variables:
export GITHUB_TOKEN="ghp_your_token_here"
export GITHUB_SECRET_KEY="your_webhook_secret"
export SLACK_TOKEN="xoxb-your_slack_token"
export SLACK_CHANNEL_ID="C1234567890"- Health Check: Visit
http://your-deployment:8080/healthto verify the service is running - Test Webhook: Create a test PR to verify webhook delivery and Slack posting
- ✅ Check that your webhook URL is publicly accessible
- ✅ Verify the webhook secret matches your configuration
- ✅ Ensure your GitHub App has the correct permissions
- ✅ Check GitHub's webhook delivery logs for errors
- ✅ Verify your Slack bot token has the required permissions
- ✅ Check that the channel ID is correct (should start with 'C')
- ✅ Ensure the bot is invited to private channels
- ✅ Review application logs for authentication errors
- ✅ Verify
githubEmailToSlackEmailmapping is correct - ✅ Use GitHub usernames (not emails) in the mapping
- ✅ Use actual Slack email addresses in the mapping
- ✅ Check that mapped users exist in both GitHub and Slack
- ✅ Ensure emoji names are valid Slack emoji codes (without colons)
- ✅ Verify the bot has
reactions:writepermission - ✅ Check that custom emojis exist in your Slack workspace
Run with debug logging to troubleshoot issues:
# Docker
docker run -e LOG_LEVEL=debug ghcr.io/loveholidays/git-slack-bot:latest
# Binary
LOG_LEVEL=debug ./git-slack-bot --config config.yaml- 📖 Check our documentation
- 🐛 Report bugs
- 💡 Request features
- 💬 Join discussions
See CONTRIBUTING.md for development setup and contribution guidelines.
This project is licensed under the GNU Lesser General Public License v3.0 - see the LICENSE file for details.
Please see SECURITY.md for reporting security vulnerabilities.