Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
message-square

GitHub Action

Send Microsoft Teams Connector Card

v1.1.0

Send Microsoft Teams Connector Card

message-square

Send Microsoft Teams Connector Card

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

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Send Microsoft Teams Connector Card

uses: xeekworx/notify-msteams@v1.1.0

Learn more about this action in xeekworx/notify-msteams

Choose a version

Send Microsoft Teams Connector Card

Description

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

Inputs

  • webhook-url (required):
    • Description: Webhook URL of the Microsoft Teams channel.
  • message-title (required):
    • Description: The title of the teams connector card.
  • message-body (required):
    • Description: The body of the message to send.
  • card-color (optional):
    • Description: The color of the card (hex) or named colors including GREEN, YELLOW, or 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'