From 4e69c4cd83cf4c48e089e90b79ea8921e9f88560 Mon Sep 17 00:00:00 2001 From: Shane Date: Wed, 31 Jan 2024 12:47:42 -0800 Subject: [PATCH] Create main.yml --- .github/workflows/main.yml | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 00000000..c1af1329 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,45 @@ +name: Post Message to Microsoft Teams + +on: + workflow_dispatch: + inputs: + message: + description: 'Message to send' + required: true + +jobs: + notify: + runs-on: windows-latest + steps: + - name: Post Adaptive Card to Microsoft Teams + run: | + $body = @{ + type = "message" + attachments = @( + @{ + contentType = "application/vnd.microsoft.card.adaptive" + contentUrl = $null + content = @{ + '$schema' = "http://adaptivecards.io/schemas/adaptive-card.json" + type = "AdaptiveCard" + version = "1.2" + body = @( + @{ + type = "TextBlock" + text = "${{ github.event.inputs.message }}" + } + ) + actions = @( + @{ + type = "Action.OpenUrl" + title = "Create Pull Request" + url = "https://github.com/microsoft/Templates-for-Power-Platform" + } + ) + } + } + ) + } | ConvertTo-Json -Depth 10 + + curl -H "Content-Type: application/json" -d "$body" ${{ secrets.TEAMS_WEBHOOK_URL }} + shell: pwsh