Slack notifications for code monitors

You can set up code monitors to send notifications about new matching search results to Slack channels.

Requirements

  • You must have permission to create apps in your organization's Slack workspace.

Usage

  1. In Sourcegraph, click on the "Code Monitoring" nav item at the top of the page.
  2. Create a new code monitor or edit an existing monitor by clicking on the "Edit" button next to it.
  3. Go through the standard steps for a code monitor (if it's a new one) and select the action Send Slack message to channel.
  4. Paste your webhook URL into the "Webhook URL" field. (See "Creating a Slack incoming webhook URL" below for detailed instructions.)
  5. Click on the "Continue" button, and then the "Save" button.

Creating a Slack incoming webhook URL

  1. Go to https://api.slack.com/apps and sign in to your Slack account if necessary.
  2. Click on the "Create an app" button.
  3. Create your app "From scratch".
  4. Give your app a name and select the workplace you want notifications sent to.
  1. Once your app is created, click on the "Incoming Webhooks" in the sidebar, under "Features".
  2. Click the toggle button to activate incoming webhooks.
  3. Scroll to the bottom of the page and click on "Add New Webhook to Workspace".
  4. Select the channel you want notifications sent to, then click on the "Allow" button.
  5. Your webhook URL is now created! Click the copy button to copy it to your clipboard.