Skip to content

nhs-england-tools/notify-msteams-action

Repository files navigation

Notify MSTeams Action

This GitHub action is designed to enable development teams to easily send notifications to an MS Teams channel from their build pipelines.

This action uses typescript and is built from the typescript-action baseline

Table of Contents

Installation

This action can be called as part of your GitHub action workflows. to achieve this follow these steps:

Add the following section to your existing workflow file:

      - name: Testing action to notify Teams
        uses: nhs-england-tools/notify-msteams-action@v0.0.4
        with:
          github-token: ${{ secrets.GITHUB_TOKEN }}
          teams-webhook-url: ${{ secrets.TEAMS_WEBHOOK_URL }}
          message-title: "Replace with an appropriate title"
          message-text: "Replace with appropriate text"
          link: https://google.com

Follow the instructions to add an Incoming Webhook to the Teams channel of your choice.

Add the webhook url from above as a repository secret with the following name:

TEAMS_WEBHOOK_URL

To work on this repository

Clone the repository

git clone https://github.com/nhs-england-tools/notify-msteams.git
cd nhs-england-tools/notify-msteams

Install and configure toolchain dependencies

make config

Prerequisites

The following software packages or their equivalents are expected to be installed

Usage

The steps above detail how to quickly use this action within your repository. The following attributes can be provided to further control the output of your notification:

  • github-token - use the default GitHub token
  • teams-webhook-url - this is the URL provided by MS Teams when you configured the incoming webhook
  • message-title - the title for your message - this will be displayed in the notification
  • message-text - the text for your message - this will be displayed in the notification
  • message-colour - The colour to use for the header line in the notification
  • link - optional if required provide a link to be presented in the notification

An example of how the notification could appear in Microsoft Teams is provided:

Microsoft Teams notification showing the adaptive card being displayed to the user for a "Pull request opened" event

Architecture

Diagrams

The C4 model is a simple and intuitive way to create software architecture diagrams that are clear, consistent, scalable and most importantly collaborative. This should result in documenting all the system interfaces, external dependencies and integration points.

Repository Template

Contributing

Describe or link templates on how to raise an issue, feature request or make a contribution to the codebase. Reference the other documentation files, like

  • Environment setup for contribution, i.e. CONTRIBUTING.md
  • Coding standards, branching, linting, practices for development and testing
  • Release process, versioning, changelog
  • Backlog, board, roadmap, ways of working
  • High-level requirements, guiding principles, decision records, etc.

Contacts

Provide a way to contact the owners of this project. It can be a team, an individual or information on the means of getting in touch via active communication channels, e.g. opening a GitHub discussion, raising an issue, etc.

Licence

The LICENCE.md file will need to be updated with the correct year and owner

Unless stated otherwise, the codebase is released under the MIT License. This covers both the codebase and any sample code in the documentation.

Any HTML or Markdown documentation is Β© Crown Copyright and available under the terms of the Open Government Licence v3.0.