-
Notifications
You must be signed in to change notification settings - Fork 2k
41 lines (40 loc) · 1.6 KB
/
notify-high-priority-triaged-issues.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
name: 'Notify on High Priority Triaged Items'
on:
issues:
types: [labeled]
jobs:
notify-on-label:
runs-on: ubuntu-latest
if: >
github.event.label.name == 'Triaged' &&
contains(github.event.issue.labels.*.name, 'Triaged') &&
contains(github.event.issue.labels.*.name, '[Pri] Blocker')
steps:
- name: Set variables based on event type
id: set-vars
run: |
echo "::set-output name=item_type::Issue"
echo "::set-output name=item_url::https://github.com/${{ github.repository }}/issues/${{ github.event.issue.number }}"
echo "::set-output name=item_title::${{ github.event.issue.title }}"
echo "::set-output name=item_number::${{ github.event.issue.number }}"
- name: Notify Slack
uses: slackapi/[email protected]
with:
channel-id: 'C02FMH4G8'
payload: |
{
"blocks": [
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": "A high priority ${{ steps.set-vars.outputs.item_type }} has been triaged and needs attention:\n*<${{ steps.set-vars.outputs.item_url }}|${{ steps.set-vars.outputs.item_type }} #${{ steps.set-vars.outputs.item_number }}: ${{ steps.set-vars.outputs.item_title }}>*"
}
}
],
"text": "A high priority triaged item needs attention",
"unfurl_links": false,
"unfurl_media": false
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_TOKEN }}