-
Notifications
You must be signed in to change notification settings - Fork 10
45 lines (42 loc) · 1.32 KB
/
send-message-to-teams.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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