File tree Expand file tree Collapse file tree 1 file changed +36
-9
lines changed Expand file tree Collapse file tree 1 file changed +36
-9
lines changed Original file line number Diff line number Diff line change 60
60
category : " /language:${{matrix.language}}"
61
61
ref : ${{ env.CHECKOUT_REF }}
62
62
sha : ${{ env.CHECKOUT_SHA }}
63
- - name : Notify to slack on failure
64
- if : ${{ failure() }}
65
-
66
- with :
67
- method : chat.postMessage
68
- token : ${{ secrets.CODE_SCANNING_SLACK_TOKEN }}
69
- payload : |
70
- channel: ${{ secrets.CODE_SCANNING_SLACK_CHANNEL_ID }}
71
- text: ":broken_heart: CodeQL analysis failed for ${{ github.repository }} on ${{ env.CHECKOUT_SHA }}."
72
63
alert :
73
64
name : Alert
74
65
runs-on : ubuntu-latest
94
85
run : |
95
86
npm ci --omit=dev
96
87
node codeql-alert
88
+ notify_on_failure :
89
+ name : Failure notification
90
+ runs-on : ubuntu-latest
91
+ needs : analyze
92
+ if : failure()
93
+ steps :
94
+ - name : Send notification to slack
95
+
96
+ with :
97
+ method : chat.postMessage
98
+ token : ${{ secrets.CODE_SCANNING_SLACK_TOKEN }}
99
+ payload : |
100
+ channel: ${{ secrets.CODE_SCANNING_SLACK_CHANNEL_ID }}
101
+ "blocks": [
102
+ {
103
+ "type": "section",
104
+ "text": {
105
+ "type": "mrkdwn",
106
+ "text": ":broken_heart: CodeQL analysis failed for ${{ github.repository }}."
107
+ }
108
+ },
109
+ {
110
+ "type": "actions",
111
+ "elements": [
112
+ {
113
+ "type": "button",
114
+ "text": {
115
+ "type": "plain_text",
116
+ "text": "View Workflow Run"
117
+ },
118
+ "url": "https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}"
119
+ }
120
+ ]
121
+ }
122
+ ]
123
+
You can’t perform that action at this time.
0 commit comments