-
Notifications
You must be signed in to change notification settings - Fork 4
34 lines (31 loc) · 1.1 KB
/
release-notify.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
name: Notify Teams on Release
on:
release:
types: [published]
jobs:
notify-teams:
runs-on: ubuntu-latest
steps:
- name: Send notification to Microsoft Teams
env:
WEBHOOK_URL: ${{ secrets.TEAMS_WEBHOOK }}
RELEASE_TAG: ${{ github.event.release.tag_name }}
RELEASE_NAME: ${{ github.event.release.name }}
RELEASE_BODY: ${{ github.event.release.body }}
REPO_NAME: ${{ github.repository }}
REPO_URL: ${{ github.event.repository.html_url }}
RELEASE_URL: ${{ github.event.release.html_url }}
run: |
curl -X POST -H "Content-Type: application/json" \
-d "{
\"text\": \"🚀 A new release has been published!\",
\"sections\": [{
\"activityTitle\": \"**Release: [${RELEASE_NAME}](${RELEASE_URL})**\",
\"activitySubtitle\": \"Repository: [${REPO_NAME}](${REPO_URL})\",
\"text\": \"${RELEASE_BODY}\",
\"facts\": [
{\"name\": \"Tag\", \"value\": \"${RELEASE_TAG}\"}
]
}]
}" \
$WEBHOOK_URL