---
title: Using Slack with Mergify
description: Learn how you can send Slack notifications for Merge Queue events, CI Insights, Test Insights quarantine activity, and pull request activities.
---

<IntegrationLogo src={slackLogo} alt="Slack logo"/>

Mergify's Slack integration sends notifications about your development
workflow directly to Slack. You can get updates about Merge Queue activities,
CI job completions, test quarantine activity, and pull request events.

## Setting Up the Mergify Slack Integration

Before configuring specific notifications, you need to connect your Slack workspace to Mergify:

1. Go to your Mergify dashboard
2. Navigate to **Integrations → Slack**
3. Follow the prompts to connect your Slack workspace
4. Authorize the Mergify app for your Slack workspace

Once connected, you can configure different types of notifications based on your team's needs.

## Merge Queue Notifications

Get real-time updates about your Merge Queue activities directly in Slack channels.

Merge Queue notifications cover:
- Pull requests entering the queue
- The queue starting and finishing checks for a pull request
- Pull requests leaving the queue, and pull requests merged out of it
- Queue [pauses](/merge-queue/pause) being created, updated, or deleted
- [Scheduled freezes](/merge-protections/freeze) being created, updated, or deleted

To set up Merge Queue notifications:

1. In your Mergify dashboard, go to **Integrations → Slack**
2. Select the Slack channel where you want to receive Merge Queue notifications
3. Choose the repositories you want to monitor
4. Configure notification preferences (all events or specific events only)

<Image src={mqCommentSlack} alt="Merge Queue activity on Slack" />

Those notifications are useful for:

- **Team Coordination**: Keep the entire team informed about merge activities
- **Release Management**: Monitor critical merges during release periods
- **Debugging**: Quickly identify when and why queue operations fail

## CI Insights Notifications

[Mergify's CI Insights](/ci-insights) can send Slack notifications about CI job
completions, allowing your team to stay informed about build statuses, test
failures, and deployment activities.

A CI Insights notification is posted when a job finishes, and contains:
- **Job and pipeline**: the job name, linked to the job in your CI, and the
  pipeline it belongs to

- **Repository and branch**: the repository, linked to GitHub, and the branch
  the job ran on

- **Conclusion**: how the job ended, with a matching emoji, when it finished,
  and how long it took

- **Pull request**: the pull request the job ran on, when there is one

- **A link to CI Insights**: a button opening that job's executions in the
  Mergify dashboard

To configure CI Insights Slack notifications:

1. **Enable CI Insights**: Make sure you have [CI Insights enabled](/ci-insights) for your repositories
2. **Configure Notifications**: In your Mergify dashboard, navigate to **Integrations → Slack**
3. **Set Up Rules**: Configure notification rules based on your criteria

<Image src={ciInsightsConfig} alt="Slack integration with CI Insights" />

### Notification Criteria

You can filter notifications on:

- **Repository**: the repositories to watch
- **Branch**: the branches the job ran on
- **Pipeline**: the pipelines or workflows the job belongs to
- **Job**: the job names
- **Job conclusion**: `action_required`, `cancelled`, `failure`, `neutral`, `skipped`, `success`, or `timed_out`

Each filter is a list of exact values picked from what CI Insights has already
recorded, and leaving one empty means "all". Wildcards and patterns are not
supported: a job matches only when its branch, pipeline, job name, and
conclusion are among the values you selected, so a release branch has to be
listed by name rather than as `release/*`.

### Example Configurations

#### Critical Failures Only
Monitor failures on the main branch for production-related jobs:
- Repository: `your-org/your-repo`
- Branch: `main`
- Job conclusion: `failure`
- Job: `deploy`, `security-scan`, `integration-tests`

#### Release Monitoring
Monitor successes and failures on the release branches you are shipping from,
each one listed by name:
- Repository: `your-org/your-repo`
- Branch: `release/2026.1`, `release/2026.2`
- Job conclusion: `failure`, `success`

#### Test Failure Alerts
Alert on failures of your test jobs across all branches, leaving the branch
filter empty:
- Repository: `your-org/your-repo`
- Job conclusion: `failure`
- Job: `unit-tests`, `integration-tests`

### Best Practices

1. **Start Broad, Then Narrow**: Begin with broader notifications and gradually
   add filters to reduce noise

2. **Use Separate Channels**: Consider different Slack channels for different
   types of notifications (e.g., #ci-failures, #deployments, #security-alerts)

3. **Focus on Critical Paths**: Prioritize notifications for jobs that affect
   production deployments or security

4. **Monitor Flaky Tests**: CI Insights notifications cannot filter on flaky
   tests. Use the Test Insights notifications below, which fire when a test is
   quarantined or dequarantined

5. **Team-Specific Filters**: Configure different notification rules for
   different teams based on their responsibilities

## Test Insights Notifications

[Mergify's Test Insights](/test-insights) can post a Slack message whenever a
test is [quarantined or dequarantined](/test-insights/quarantine), so your team
sees mitigation activity as it happens (whether a teammate acted from the
dashboard or CLI, or Mergify quarantined the test automatically).

Test Insights notifications include:
- **Test**: The affected test, linked to its details page
- **Repository**: The repository the test belongs to
- **Action**: Whether the test was quarantined or dequarantined
- **Source**: Who acted: a teammate or Mergify's automatic quarantine
- **Health status**: The test's health at the time of the event
- **Reason**: Why the test was quarantined (on quarantine events)

To configure Test Insights Slack notifications:

1. **Enable Test Insights**: Make sure you have [Test Insights](/test-insights)
   set up for your repositories

2. **Connect Slack**: In your Mergify dashboard, navigate to **Integrations → Slack**

3. **Add the notification**: On a channel, add a **Test Insights** notification,
   then choose the repositories to monitor and which events (quarantine,
   dequarantine) to subscribe to

Test Insights notifications are available on the same plans as the
[quarantine feature](/test-insights/quarantine).

## Pull Request Notifications via GitHub-Slack Integration

In addition to native Mergify notifications, you can also receive Slack
notifications based on Mergify actions by using the GitHub to Slack
integration.

### Setting Up GitHub-Slack Integration

1. Go to [Slack's GitHub Integration page](https://slack.github.com/)

2. Click on the `Add to Slack` button

3. Invite the GitHub app to the channel you want. Refer to the
   [documentation](https://github.com/integrations/slack/blob/master/README.md)
   for more details

4. Make sure you subscribe to the repositories [to receive the
   mentions](https://github.com/integrations/slack/blob/master/README.md#mentions)
   as private message for the GitHub Slack app

### Using Mergify's Comment Action with Slack Notifications

You can use Mergify's [comment action](/workflow/actions/comment/) to mention
users in PR comments, which will trigger Slack notifications if the user has
GitHub integrated with Slack.

Here's an example that notifies the PR author when CI fails on hotfix PRs:

```yaml
pull_request_rules:
  - name: Notify author on CI failure for hotfixes
    conditions:
      - "#check-failure > 0"
      - "label = hotfix"
    actions:
      comment:
        message: "@{{author}} :warning: The CI failed on this hotfix PR. Please review the issues and address them."
```

This rule:
- Checks for CI failures with `#check-failure > 0`
- Ensures the PR has the `hotfix` label
- Comments mentioning the PR author using `@{{author}}`
- Triggers a Slack notification if the author has GitHub-Slack integration enabled

### Use Cases

- **Critical PR Alerts**: Notify authors about urgent issues with hotfix or
  release PRs

- **Review Requests**: Automatically mention reviewers when PRs are ready

- **Status Updates**: Keep stakeholders informed about important PR milestones

## Troubleshooting

If you're not receiving expected notifications:

1. **Check Integration Status**: Verify that Slack integration is properly
   connected in your Mergify dashboard

2. **Review Notification Settings**: Ensure your notification rules are
   correctly configured

3. **Verify Channel Permissions**: Make sure the Mergify Slack app has
   permission to post in your target channels

4. **Test with Broader Filters**: Temporarily use broader criteria to confirm
   the integration is working

5. **Check Repository Access**: Ensure Mergify has access to the repositories
   you want to monitor
