byu-oit/github-action-teams

Make notification look more like GitHub Actions UI

Closed this issue · 1 comments

GitHub Actions looks like:
image

I see that we can send a notification that looks like:
image

To recreate this, go to the Adaptive Card Designer, select Microsoft Teams as the host app, switch the theme to Dark, and enter the following JSON into the Card Payload Editor:

{
  "type": "AdaptiveCard",
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "version": "1.4",
  "msteams": {
    "width": "Full"
  },
  "body": [
    {
      "type": "ColumnSet",
      "bleed": true,
      "spacing": "None",
      "columns": [
        {
          "type": "Column",
          "items": [
            {
              "type": "TextBlock",
              "text": "The [**Deploy**]() workflow on the [**dev**]() branch of [**byu-oit/hw-fargate-api**]() was **successful**!",
              "wrap": true
            }
          ],
          "width": "stretch"
        },
        {
          "type": "Column",
          "items": [
            {
              "type": "ActionSet",
              "actions": [
                {
                  "type": "Action.OpenUrl",
                  "title": "View Run",
                  "url": "https://example.com"
                }
              ]
            }
          ],
          "width": "auto"
        }
      ]
    },
    {
      "type": "ColumnSet",
      "separator": true,
      "columns": [
        {
          "type": "Column",
          "width": "18px",
          "items": [
            {
              "type": "Image",
              "url": "https://raw.githubusercontent.com/Skitionek/notify-microsoft-teams/master/icons/success.png",
              "altText": "Success"
            }
          ]
        },
        {
          "type": "Column",
          "width": "stretch",
          "items": [
            {
              "type": "TextBlock",
              "text": "Merge pull request #693 from byu-oit/readme",
              "wrap": true,
              "weight": "Bolder",
              "size": "Medium"
            },
            {
              "type": "TextBlock",
              "text": "[**Deploy**]() #271: Commit [**7419b43**]() pushed by [**joshgubler**]() (Josh Gubler)",
              "wrap": true,
              "size": "Small"
            }
          ]
        }
      ]
    }
  ]
}

Released as v3.0.0.