Skip to content

An action that enables easy sending of customizable notifications to Microsoft Teams.

License

Notifications You must be signed in to change notification settings

xeekworx/notify-msteams

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Send Microsoft Teams Connector Card

Test Run for Action CodeQL

Description

Sends a custom connector card to a Microsoft Teams channel using a webhook URL.

Usage

Inputs

  • webhook-url (required):
  • message-title (required):
    • Description: The title of the teams connector card.
  • message-body (required):
  • card-color (optional):
    • Description: The color of the card (hex, eg. #22c74e) or predefined colors including:
      • #22c74e GREEN
      • #c73022 YELLOW
      • #c7bf22 RED
    • Default: Not specified.
  • buttons (optional):
    • Description: Buttons to add to the card. Each button is a pair of text and link separated by a new line or semicolon (;).
    • Default: Not specified.
  • dry-run (optional):
    • Description: Enable dry run mode. If set to 'true', the action will not send the payload.
    • Default: 'false'.
  • output-payload (optional):
    • Description: Output the JSON payload being sent to the webhook.
    • Default: 'false'.

Example Usage

name: Send Teams Connector Card
on:
  push:
    branches:
      - main

jobs:
  send-connector-card:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout Code
      uses: actions/checkout@v4

    - name: Send Microsoft Teams Connector Card
      uses: xeekworx/notify-msteams@v1
      with:
        webhook-url: ${{ secrets.TEAMS_WEBHOOK_URL }}
        message-title: 'New Release'
        message-body: 'A new version of our software is now available!'
        card-color: 'GREEN'
        buttons: |
          Button One, http://example.com
          Button Two, http://example.com
        dry-run: 'false'

Acknowledgments

This project uses pymsteams, a Python wrapper for Microsoft Teams webhooks. pymsteams is distributed under the Apache License, Version 2.0. See LICENSE for more details.

About

An action that enables easy sending of customizable notifications to Microsoft Teams.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages