Skip to content
Latchkey

How to Notify a Microsoft Teams Channel From GitHub Actions

A Teams Workflows (Power Automate) incoming webhook accepts a JSON Adaptive Card you can POST with curl.

Create an incoming webhook on the Teams channel, store the URL as a secret, then POST an Adaptive Card payload with curl from a workflow step.

Steps

  • Add an incoming webhook to the Teams channel and copy the URL.
  • Store it as the TEAMS_WEBHOOK_URL secret.
  • POST an Adaptive Card JSON body with curl.

Workflow

.github/workflows/ci.yml
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - run: npm ci && npm test
      - name: Notify Teams
        if: always()
        run: |
          curl -s -H "Content-Type: application/json" -d '{
            "type": "message",
            "attachments": [{
              "contentType": "application/vnd.microsoft.card.adaptive",
              "content": {
                "type": "AdaptiveCard",
                "version": "1.4",
                "body": [{ "type": "TextBlock", "text": "Build ${{ job.status }} on ${{ github.ref_name }}" }]
              }
            }]
          }' "${{ secrets.TEAMS_WEBHOOK_URL }}"

Gotchas

  • The classic Office 365 connector webhooks are retired; use a Teams Workflows webhook URL.
  • Adaptive Cards must be wrapped in the attachments envelope shown above, not sent raw.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →