JSPM

  • Created
  • Published
  • Downloads 62930
  • Score
    100M100P100Q172886F
  • License MIT

A slack bot for semantic-release notifying release statuses

Package Exports

  • semantic-release-slack-bot

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (semantic-release-slack-bot) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

semantic-release-slack-bot

semantic-release plugin to get release notifications on slack from a slack bot

Step Description
success Send a slack message to notify of a new release.
fail Send a slack message to notify of a failed release.

npm npm license add to slack

Install

Add the plugin to your npm-project:

$ npm install semantic-release-slack-bot -D

The corresponding slack app has be installed in you slack workspace as well. Follow the instructions under configuration for more information.

Usage

The plugin can be configured in the semantic-release configuration file:

{
    "plugins": [
        "@semantic-release/commit-analyzer",
        "@semantic-release/release-notes-generator",
        [
            "semantic-release-slack-bot",
            {
                "notifyOnSuccess": false,
                "notifyOnFail": true
            }
        ]
    ]
}

With this example:

  • Slack notifications are skipped on a succesfull release
  • Slack notifications are sent on a failed release

Screenshots

Screenshot of success Screenshot of fail

Configuration

Slack app installation

The plugin uses a slack webhook which you get by adding the slack app to your slack workspace. Register the app using the button below or this link.

Add to Slack

Slack app authentication

Installing the app will yield you with a webhook that the app uses to publish updates to your selected chanel. The Slack webhook authentication link is required and needs to be kept a secret. It should be defined in the environment variables.

Environment variables

The SLACK_WEBHOOK variable has to be defined in the environment where you will be running semantic release. This can be done by exporting it in bash or in the user interface of you CI provider. Obtain this token by installing the slack app according to slack app installation.

Variable Description
SLACK_WEBHOOK Slack webhook created when adding app to workspace.

Options

Option Description Default
notifyOnSuccess Determines if a succesfull release should trigger a slack message to be sent. If false this plugin does nothing on success. false
notifyOnFail Determines if a failed release should trigger a slack message to be sent. If false this plugin does nothing on fail. false