Sends an AdaptiveCard notification to an MS Teams Incoming Webhook from a GitHub Action Workflow
This action requires a secret to be set up with your Teams Incoming Webhook URL named MS_TEAMS_WEBHOOK_URL
(official docs for creating secrets in your repo)
github-token
github-token: ${{ github.token }}
webhook-url
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
title
title: "Test Message Heading"
message
""
message: "This is some test message content for a simple notification"
color
"default"
default
, info
, success
, failure
, warning
as valuescolor: "info"
deploy-card
false
deploy-card: true
timezone
"America/New_York"
timezone: "Europe/Rome"
This action was built with the intention of sending workflow status notifications but also supports a simple message style
The following sends a simple notification with a title and message
- name: Send simple notification
uses: mikesprague/teams-incoming-webhook-action@v1
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
title: 'Notification Test'
message: 'This is an example of a simple notification with a title and a body'
The following examples show how to send notifications based on your workflow status
Include as first step in workflow to notify workflow run has started
- name: Deploy Started Notification
uses: mikesprague/teams-incoming-webhook-action@v1
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: 'Deployment Started'
color: 'info'
Include anywhere in steps to notify workflow run has been cancelled
- name: Cancelled Notification
if: ${{ cancelled() }}
uses: mikesprague/teams-incoming-webhook-action@v1
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: 'Deployment Cancelled'
color: 'warning'
Include anywhere in steps to notify when a workflow run fails
- name: Failure Notification
if: ${{ failure() }}
uses: mikesprague/teams-incoming-webhook-action@v1
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: 'Deployment Failed'
color: 'failure'
Include anywhere in steps to notify when workflow run is successful
- name: Success Notification
if: ${{ success() }}
uses: mikesprague/teams-incoming-webhook-action@v1
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: 'Deployment Successful'
color: 'success'