-
Notifications
You must be signed in to change notification settings - Fork 13
67 lines (64 loc) · 3.09 KB
/
stale-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
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
# Sends an MS Teams notification if a PR is marked Stale
# Currently uses MessageCard and not AdaptiveCard.
# Changing to AdaptiveCard might require forking & changing the action b/c current action automatically add MessageCard syntax
name: Notify Team on stale pull requests
on:
issues:
types: [labeled]
pull_request_target:
types: [labeled]
# Use pull_request_target to handle PR with merge conflicts
jobs:
notify:
name: Send MS notifications for Stale PR/Issue
if: ${{ github.event.label.name == 'stale' }}
runs-on: ubuntu-latest
steps:
- name: Debug GitHub context
env:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"
- uses: actions/checkout@v3
- name: Notify dedicated teams channel
uses: skitionek/notify-microsoft-teams@master
with:
webhook_url: ${{ secrets.MS_TEAMS_HUB_NOTIFICATIONS_WEBHOOK_URI }}
# for possible github properties see
# https://docs.github.com/en/developers/webhooks-and-events/webhooks/webhook-events-and-payloads
raw: >-
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"themeColor": "0076D7",
"summary": "Stale Pull Request",
"sections": [{
"activityTitle": "**Stale Pull Request / Issue**",
"activitySubtitle": "${{ github.event.issue.title }}${{ github.event.pull_request.title }} from ${{ github.event.issue.user.login }}${{ github.event.pull_request.user.login }}",
"activityImage": "${{ github.event.issue.user.avatar_url }}${{ github.event.pull_request.user.avatar_url }}",
"facts": [{
"name": "Requested Reviewers",
"value": "${{ join(github.event.issue.assignees.*.login, ', ') }}${{ join(github.event.pull_request.requested_reviewers.*.login, ', ') }}"
}, {
"name": "Mergeable",
"value": "${{ github.event.pull_request.mergeable }}"
}, {
"name": "Labels",
"value": "${{ join(github.event.issue.labels.*.name, ', ') }}${{ join(github.event.pull_request.labels.*.name, ', ') }}"
}, {
"name": "Updated",
"value": "${{ github.event.issue.updated_at }}${{ github.event.pull_request.updated_at }}"
}, {
"name": "Status",
"value": "${{ github.event.issue.state }}${{ github.event.pull_request.state }}"
}],
"markdown": true
}],
"potentialAction": [{
"@type": "OpenUri",
"name": "View the Issue",
"targets": [{
"os": "default",
"uri": "${{ github.event.issue.html_url }}${{ github.event.pull_request.html_url }}"
}]
}]
}