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)
The action also expects a CODECOV_TOKEN repository secret for Codecov integration. If you do not want to use Codecov, you can comment out the Upload coverage reports to Codecov step in .github/workflows/build-and-test.yml.
github-token
github-token: ${{ github.token }}webhook-url
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}title
title: "Test Message Heading"title-size
"Default"Default, Large as valuestitle-size: "Large"message
""deploy-card is true, this appears above the deployment detailsmessage: "This is some test message content for a simple notification"color
"default"default, info, success, failure, warning as valuescolor: "info"deploy-card
falsedeploy-card: trueshow-commit-message
falseshow-commit-message: truetimezone
"America/New_York"timezone: "Europe/Rome"user-mentions
""name|id, comma separated (e.g. Alice|alice@example.com,Bob|bob@example.com).
id should be the user's Entra ID or UPN (email) for the mention to work properlyuser-mentions: "Alice|alice@example.com,Bob|bob@example.com"When the action runs, it takes the inputs provided and constructs an AdaptiveCard payload that is sent to the specified MS Teams Webhook URL. The card can be customized with a title, message body, color, and can optionally include dynamic information about the GitHub workflow run (like commit message and author). See the Example Usage section for details on how to customize the card with different inputs.
flowchart LR
subgraph Row1[ ]
direction LR
A[GitHub Workflow] --> B["mikesprague/teams-incoming-webhook-action"]
end
subgraph Row2[ ]
direction LR
C[Teams Incoming Webhook] --> D[Teams Channel]
end
B --> C
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@v2
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
title: 'Simple Notification'
message: 'This is an example of a simple notification with a title and a body'

The following sends a simple notification with a title and message
- name: Send Simple Notification w/ Large Title
uses: mikesprague/teams-incoming-webhook-action@v2
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
title: 'Simple Notification w/ Large Title'
title-size: 'Large'
message: 'This is an example of a simple notification with a large title and a body'

The following sends a simple notification with user mentions
- name: Send Simple Notification w/ User Mentions
uses: mikesprague/teams-incoming-webhook-action@v2
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
title: 'Simple Notification w/ User Mentions'
message: 'This is an example of a simple notification that includes user mentions'
user-mentions: 'Alice|alice@example.com,Bob|bob@example.com'

The following examples show how to send notifications based on your workflow status
- name: Send Workflow Status Notification w/ Message
uses: mikesprague/teams-incoming-webhook-action@v2
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: 'Workflow Status w/ Message'
message: 'This is an example of a workflow notification with a custom message included in the card body'

- name: 📤 Send Workflow Status Notification w/ Commit Message
uses: mikesprague/teams-incoming-webhook-action@v2
with:
github-token: ${{ github.token }}
webhook-url: ${{ env.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: "Workflow Status w/ Commit Message"
show-commit-message: true

Include as first step in workflow to notify workflow run has started
- name: Send Workflow Status Notification
uses: mikesprague/teams-incoming-webhook-action@v2
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: 'Workflow Status'
color: 'info'

Include anywhere in steps to notify workflow run has been cancelled
- name: Send Workflow Cancelled Notification
if: ${{ cancelled() }}
uses: mikesprague/teams-incoming-webhook-action@v2
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: 'Workflow Cancelled'
color: 'warning'

Include anywhere in steps to notify when a workflow run fails
- name: Send Workflow Failure Notification
if: ${{ failure() }}
uses: mikesprague/teams-incoming-webhook-action@v2
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: 'Workflow Failed'
color: 'failure'

Include anywhere in steps to notify when workflow run is successful
- name: Send Workflow Success Notification
if: ${{ success() }}
uses: mikesprague/teams-incoming-webhook-action@v2
with:
github-token: ${{ github.token }}
webhook-url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: 'Workflow Successful'
color: 'success'

Sends a deploy card with all options enabled - large title, custom message, color, commit message visible, and user mentions
- name: Kitchen Sink Test
uses: mikesprague/teams-incoming-webhook-action@v2
with:
github-token: ${{ github.token }}
webhook-url: ${{ env.MS_TEAMS_WEBHOOK_URL }}
deploy-card: true
title: "Kitchen Sink Test"
title-size: "Large"
message: "This is a kitchen sink test sending a deploy card with all options set including a custom message, color, large title, showing the commit message, and user mentions."
color: "info"
show-commit-message: true
user-mentions: "Alice|alice@example.com,Bob|bob@example.com"

This project uses modern TypeScript with strict type checking and comprehensive test coverage.
npm install
The project uses Vitest for testing with comprehensive coverage requirements:
# Run tests once
npm test
# Run tests in watch mode
npm run test:watch
# Run tests with coverage report
npm run test:coverage
# Run tests with UI
npm run test:ui
CI also runs npm run test:coverage, uploads the report to Codecov,
and includes the HTML coverage report in the published docs artifact (docs/publish/coverage)
which is available to view via GH Pages: https://mikesprague.github.io/teams-incoming-webhook-action/coverage/
Coverage Thresholds:
Latest Vitest-generated coverage report can always be found at https://mikesprague.github.io/teams-incoming-webhook-action/coverage/ and latest Codecov report can viewed at https://codecov.io/github/mikesprague/teams-incoming-webhook-action
The project uses Biome for linting and formatting:
# Check code quality
npm run lint
# Type check
npm run typecheck
# Build the action
npm run build
The project uses TypeScript 5.9+ with:
This project uses TypeDoc to generate API documentation during CI (npm run build) via the postbuild script.
The generated docs are published to GitHub Pages at https://mikesprague.github.io/teams-incoming-webhook-action/.