1.0.9 • Published 6 months ago

semantic-release-discord-notifier v1.0.9

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
6 months ago

semantic-release-discord-notifier

A semantic-release plugin to send release notifications to Discord.

Installation

npm install semantic-release-discord-notifier

Usage

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

{
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    ["semantic-release-discord-notifier", {
      "webhookUrl": "https://discord.com/api/webhooks/your-webhook-url",
      "embedJson": {
        "title": "New Release: ${nextRelease.version}",
        "description": "${nextRelease.notes}",
        "color": 5814783
      }
    }]
  ]
}

Configuration

Environment Variables

VariableDescription
DISCORD_WEBHOOKThe Discord webhook URL (if not in config)

Options

OptionDescriptionDefault
webhookUrlThe Discord webhook URLundefined
embedJsonA custom Discord embed JSON objectSee below

If embedJson is not provided, the default embed will be:

{
  "title": "New Release: ${nextRelease.version}",
  "description": "${nextRelease.notes}",
  "fields": [
    { "name": "Branch", "value": "${branch.name}" },
    { "name": "Commits", "value": "${commits}" }
  ],
  "color": 5814783
}

Variable Substitution

The plugin supports variable substitution in the embedJson. You can use ${variable} syntax to insert values from the semantic-release context. For example, ${nextRelease.version} will be replaced with the version of the new release.

Available context variables include:

  • nextRelease.version
  • nextRelease.notes
  • branch.name
  • commits (array of commit objects)
  • lastRelease.version

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

7 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago