File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Notify Teams on new PR
2+
3+ on :
4+ pull_request :
5+ types : [opened]
6+
7+ jobs :
8+ notify :
9+ runs-on : ubuntu-latest
10+ steps :
11+ - name : Post card to Microsoft Teams
12+ env :
13+ TEAMS_WEBHOOK_URL : ${{ secrets.TEAMS_WEBHOOK_URL }}
14+ run : |
15+ payload=$(cat <<'JSON'
16+ {
17+ "@type": "MessageCard",
18+ "@context": "http://schema.org/extensions",
19+ "summary": "Neuer Pull Request",
20+ "themeColor": "0076D7",
21+ "title": "Neuer PR: #${{ github.event.pull_request.number }} – ${{ github.event.pull_request.title }}",
22+ "sections": [{
23+ "activityTitle": "[${{ github.event.pull_request.user.login }}](${{ github.event.pull_request.user.html_url }}) hat einen Pull Request eröffnet",
24+ "facts": [
25+ {"name": "Repository", "value": "${{ github.repository }}"},
26+ {"name": "Branch", "value": "${{ github.event.pull_request.head.ref }} → ${{ github.event.pull_request.base.ref }}"},
27+ {"name": "Entwurf", "value": "${{ github.event.pull_request.draft }}"}
28+ ],
29+ "markdown": true
30+ }],
31+ "potentialAction": [{
32+ "@type": "OpenUri",
33+ "name": "PR öffnen",
34+ "targets": [{"os": "default", "uri": "${{ github.event.pull_request.html_url }}"}]
35+ }]
36+ }
37+ JSON
38+ )
39+ curl -sS -X POST \
40+ -H "Content-Type: application/json" \
41+ -d "$payload" \
42+ "$TEAMS_WEBHOOK_URL"
You can’t perform that action at this time.
0 commit comments