-
Notifications
You must be signed in to change notification settings - Fork 4
67 lines (65 loc) · 2.31 KB
/
pr-notification.yaml
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: Notify Teams on Pull Requests
on:
pull_request:
types: [opened, reopened]
jobs:
notify-teams:
runs-on: ubuntu-latest
steps:
- name: Send Notification to Teams
env:
TEAMS_WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK_URL }}
run: |
curl -H "Content-Type: application/json" -d '{
"type": "message",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"body": [
{
"type": "TextBlock",
"size": "Large",
"weight": "Bolder",
"text": "Pull Request ${{ github.event.action }}"
},
{
"type": "FactSet",
"facts": [
{
"title": "Title",
"value": "${{ github.event.pull_request.title }}"
},
{
"title": "Author",
"value": "${{ github.event.pull_request.user.login }}"
},
{
"title": "Status",
"value": "${{ github.event.pull_request.state }}"
},
{
"title": "Repository",
"value": "${{ github.repository }}"
},
{
"title": "Branch",
"value": "${{ github.event.pull_request.head.ref }} → ${{ github.event.pull_request.base.ref }}"
}
]
}
],
"actions": [
{
"type": "Action.OpenUrl",
"title": "View Pull Request",
"url": "${{ github.event.pull_request.html_url }}"
}
],
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.0"
}
}
]
}' $TEAMS_WEBHOOK_URL