github-actions

Send Adaptive Card to Teams

Post an Adaptive Card to a Microsoft Teams channel using a Teams webhook URL.

This action expects only the Adaptive Card body JSON. It builds the outer card envelope ($schema, type, version, msteams) for you.

Inputs

Outputs

This action does not define outputs.

Permissions

Set permissions in the calling workflow/job. Composite actions cannot declare permissions.

Example

jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
      - name: Send Adaptive Card
        uses: ./.github/actions/send-adaptive-card-to-teams
        with:
          teams-webhook-url: $
          body-json: >-
            [
              {
                "type": "Container",
                "items": [
                  {
                    "type": "TextBlock",
                    "text": "Deployment complete",
                    "weight": "Bolder",
                    "size": "Medium"
                  },
                  {
                    "type": "TextBlock",
                    "text": "Service is healthy in production",
                    "wrap": true
                  }
                ]
              }
            ]

Notes