1.2.0 • Published 1 year ago

semantic-release-discord v1.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

semantic-release-discord

semantic-release plugin to get release notifications on discord using discord webhook

Install

Add the plugin to your npm-project:

$ npm install semantic-release-discord -D

Configuration

You need to have a discord webhook.

This plugin has to be configured in the semantic-release configuration file. Example:

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    [
      "semantic-release-discord",
      {
        "notifyOnSuccess": true,
        "notifyOnFail": true,
        "discordWebhookId": "000000000000000000",
        "discordWebhookToken": "my-token"
      }
    ]
  ]
}

Options

OptionDescriptionDefault
notifyOnSuccessDetermines if a successful release should trigger a discord message to be sent. If false this plugin does nothing on success.true
notifyOnFailDetermines if a failed release should trigger a discord message to be sent. If false this plugin does nothing on fail.true
onSuccessTemplateProvides a template for the Discord message object on success when notifyOnSuccess is true. See templating.undefined
discordWebhookIdDiscord web hook id.value of the environment variable matching discordWebhookIdVar
discordWebhookIdVarThis decides what the environment variable for exporting the discord webhook id value.DISCORD_WEBHOOK_ID
discordWebhookTokenDiscord web hook token.value of the environment variable matching discordWebhookTokenVar
discordWebhookTokenVarThis decides what the environment variable for exporting the discord webhook token value.DISCORD_WEBHOOK_TOKEN

Templating

This template will be used for the respective Discord message. The template should be an object that follows the Discord webhook Form Params. Strings within the template will have keywords replaced:

KeywordDescriptionExample
$package_nameThe name of the package.semantic-release-test
$npm_package_versionThe version of the release.1.0.93
$repo_pathThe repository path.juliuscc/semantic-release-test
$repo_urlThe repository URL.https://github.com/juliuscc/semantic-release-test
$release_notesThe notes of the release.

A sample configuration with template can look like this

"onSuccessTemplate": {
  "content": "A new version of $package_name as been released !",
  "username": "$package_name",
  "embeds": [
    {
      "title": "$package_name $npm_package_version",
      "url": "$repo_url",
      "description": "$release_notes",
      "color": 16776960
    }
  ]
}
1.2.0

1 year ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.2.2

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago