-
Notifications
You must be signed in to change notification settings - Fork 10
50 lines (46 loc) · 1.6 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
46
47
48
49
50
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: |
$sas="https://poweraccelerators.blob.core.windows.net/accelerators/simplefile.txt?se=2025-02-06T21%3A55%3A41Z&sp=r&sv=2022-11-02&sr=b&big=Yty8wka7nF5rqUnGjqFsPaaPRzryZ7DTmGtutqS2hY0%3D"
$sasTrimmed = $sas.Substring(8)
$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.5"
body = @(
@{
wrap = true
maxLines = 3
type = "TextBlock"
text = "Click below to download the AppSource Package"
}
)
actions = @(
@{
type = "Action.OpenUrl"
title = "Download Azure Blob File"
url = "$sasTrimmed"
}
)
}
}
)
} | ConvertTo-Json -Depth 10
curl -H "Content-Type: application/json" -d "$body" ${{ secrets.TEAMS_WEBHOOK_URL }}
shell: pwsh