yllieth / semantic-release-ms-teams

A plugin for semantic-release which publish release notes in a Microsoft Teams channel
MIT License
19 stars 15 forks source link
release-notes semantic-release-plugin teams webhook

semantic-release-ms-teams

semantic-release plugin to send release notes to a teams channel when the release succeeds.

Step Description
verifyConditions Check the webhookUrl option or TEAMS_WEBHOOK_URL variable.
generateNotes Allow sending release note to MS Teams in dry-run mode.
success Send a Teams message to notify of a new release.

Installation

npm install semantic-release-ms-teams --save-dev
# or
yarn add semantic-release-ms-teams --dev

This plugin is using an incoming webhook to notify a teams channel. Here is some documentation to create one.

Usage

// .releaserc.json
{
  "branches": ["main"],
  "plugins": [
    "@semantic-release/commit-analyzer",
    "@semantic-release/release-notes-generator",
    ["semantic-release-ms-teams", {
      "webhookUrl": "...",
      "title": "A new version has been released",
      "imageUrl": "http://...",
      "showContributors": false,
      "notifyInDryRun": true,
    }]
  ]
}
Variable Details Description
webhookUrl or TEAMS_WEBHOOK_URL required, url The incoming webhook url of the channel to publish release notes to.
webhookUrlDryRun or TEAMS_WEBHOOK_URL_DRYRUN optional, url Similar to webhookUrl or TEAMS_WEBHOOK_URL, but will be used in dryRun mode. Default: webhookUrl or TEAMS_WEBHOOK_URL
title optional, text The title of the message. Default: A new version has been released
imageUrl optional, url An image displayed in the message, next to the title. The image must be less than 200x200.
showContributors optional, boolean Whether or not the contributors should be displayed in the message. Default: true
notifyInDryRun optional, boolean Whether or not the release notes will be send to Teams when semantic-release runs in dry-run mode. Default: true

Notes

Screenshots

preview preview

Development

Here are some steps to test the plugin locally:

Dependencies

Greatly inspired by semantic-release-slack-bot ... Thanks ;)