Deploy notifications

Deploy notifications can inform you or external services about your site’s deploy activity.

This is the list of deploy events supported by Netlify:

  • Deploy started: this event is emitted when Netlify starts building your site for a new deploy.
  • Deploy succeeded: this event is emitted when Netlify finishes propagating a new deploy in our CDN.
  • Deploy failed: this event is emitted when a deploy does not complete.
  • Deploy locked: this event is emitted when a deploy is locking a site.
  • Deploy unlocked: this event is emitted when a deploy stops locking a site.

You can enable notifications for deploy events in your site dashboard at Settings > Build & deploy > Deploy notifications. Select the type of notification you want to create and add the required configuration.

null

Slack notifications

This feature may not be available on all plans.

This type of notification allows you to send messages to a Slack channel when Netlify emits events.

Before configuring this notification, make sure you read Slack's documentation on incoming webhooks.

null

Outgoing webhooks

This feature may not be available on all plans.

This type of notification allows you to send event information to an arbitrary URL using a POST request.

The body of the outgoing webhook request will have a JSON representation of the object relevant to the event.

null

Payload signature

If you provide a JWS secret token for an outgoing webhook, Netlify will generate a JSON Web Signature(JWS) and send it along with the notification in the request header X-Webhook-Signature.

We include the following fields in the signature's data section:

  • iss: always sent with value netlify, identifying the source of the request
  • sha256: the hexadecimal representation of the generated payload's SHA256

You can use any JWT client library to verify this signature in the service receiving the notification. This is an example of an API built with the Sinatra framework that verifies the signature header:

require "digest"
require "jwt"
require "sinatra"

def signed(request, body)
  signature = request["X-Webhook-Signature"]
  return unless signature

  options = {iss: "netlify", verify_iss: true, algorithm: "HS256"}
  decoded = JWT.decode(signature, "your signature secret", true, options)

  ## decoded :
  ## [
  ##   { sha256: "..." }, # this is the data in the token
  ##   { alg: "..." } # this is the header in the token
  ## ]
  decoded.first[:sha256] == Digest::SHA256.hexdigest(body)
rescue JWT::DecodeError
  false
end

post "/netlify-hook" do
  body = request.body.read
  halt 403 unless signed(request, body)

  json = JSON.parse(body)
  # do something with the notification payload here
end

Email notifications

This feature may not be available on all plans.

This type of notification allows you to send event information to an email address of your choice.

null

GitHub commit statuses

This type of notification sets commit status directly in your GitHub pull requests and commit lists. For successful deploys, this will include a link to the Deploy Preview. For failed deploys, this will include a link to the detail page for the deploy where you can examine the deploy log and/or retry the deploy.

null

These notifications are added to all new GitHub-connected Netlify sites by default. You can add, remove, or edit them from the site dashboard at Settings > Build & deploy > Deploy notifications.

The settings include a field for a custom message, which will replace the “Deploy preview ready!” message that displays by default.

null

GitHub pull request comments

This type of notification adds a comment to your GitHub pull requests indicating the status of the associated deploy and providing a link to the Deploy Preview when ready. If you append more commits to a pull request, this notification will update the comment to indicate status changes.

null

You can add a GitHub pull request comment notification from the site dashboard at Settings > Build & deploy > Deploy notifications.

The settings include a field for a custom message, which will replace the “Deploy preview ready!” message that displays by default.

null

GitHub commit checks

This type of notification adds rich deploy information from your deploy summary to your GitHub pull requests and commit lists. This includes more detailed information in the Checks tab of your pull requests on GitHub.

null

These notifications are added to all new GitHub-connected Netlify sites by default. You can add, remove, or edit them from the site dashboard at Settings > Build & deploy > Deploy notifications.

null

If you don’t find the option for GitHub commit checks in the Add notification dropdown, you will need to configure your site to use the Netlify GitHub App.

GitLab commit statuses

This type of notification creates commit statuses in your GitLab repositories.

null

It requires a GitLab API token with access to the repository. You can set that token when you configure this notification:

null

GitLab merge request comments

This type of notification adds a comment to your GitLab merge requests indicating the status of the associated deploy and providing a link to the Deploy Preview when ready. If you append more commits to a merge request, this notification will update the comment to indicate status changes.

null

It requires a GitLab API token with access to the repository. You can set that token when you configure this notification:

null

Bitbucket notifications

Bitbucket deploy notifications are not available because Bitbucket's API functionality does not support Deploy Previews.

Zapier integrations

This feature may not be available on all plans.

Netlify is available on Zapier, where you can connect Netlify with over 1,000 other applications. You can use Zapier "Zaps" to trigger an action in another service on every successful deploy or when a deploy does not complete. You can find out more on our blog, or use one of the templates below to get started:

Incoming webhooks

Build hook metadata

Build hook payload