-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
30 lines (28 loc) · 1.1 KB
/
Copy pathaction.yml
File metadata and controls
30 lines (28 loc) · 1.1 KB
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
name: "Notify Slack on CI failure"
description: "Sends a Slack notification with workflow failure details"
inputs:
slack-webhook-url:
description: "Slack Webhook URL"
required: true
mention-channel:
description: "Whether to mention the channel in the notification"
required: false
default: "true"
runs:
using: "composite"
steps:
- name: Send Slack notification
uses: slackapi/slack-github-action@45a88b9581bfab2566dc881e2cd66d334e621e2c # v3.0.3
with:
webhook: ${{ inputs.slack-webhook-url }}
webhook-type: incoming-webhook
payload: |
text: ${{ github.repository }} - ${{ github.workflow }} failed on ${{ github.ref_name }}
blocks:
- type: "section"
text:
type: "mrkdwn"
text: |
${{ github.repository }} - *${{ github.workflow }}* failed on `${{ github.ref_name }}`
${{ inputs.mention-channel == 'true' && '<!channel>' || '' }}
<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|View Logs>