-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (47 loc) · 1.48 KB
/
send-notification.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
name: "Send notification"
on:
workflow_call:
inputs:
CVE_CRITICAL:
required: true
type: string
CVE_HIGH:
required: true
type: string
CVE_MEDIUM:
required: true
type: string
secrets:
SLACK_WEBHOOK_URL:
required: true
jobs:
Notify:
name: Notify Slack
runs-on: ubuntu-latest
steps:
- name: Send notification to Slack
id: slack
uses: slackapi/slack-github-action@6c661ce58804a1a20f6dc5fbee7f0381b469e001 #v1.25.0
with:
payload: |
{
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "[ ${{ github.event.repository.name }} ]"
}
},
{
"type": "section",
"text": {
"type": "mrkdwn",
"text": " `CRITICAL` : *${{ inputs.CVE_CRITICAL }}*\n\n`HIGH` : *${{ inputs.CVE_HIGH }}*\n\n`MEDIUM` : *${{ inputs.CVE_MEDIUM }}*\n\n<https://github.com/${{ github.repository }}/security/code-scanning${{ github.event.pull_request.number != '' && format('?query=pr:{0}', github.event.pull_request.number) || '' }} | See details on GitHub>"
}
}
]
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
SLACK_WEBHOOK_TYPE: INCOMING_WEBHOOK