-
Notifications
You must be signed in to change notification settings - Fork 234
/
Copy pathaction.yml
53 lines (48 loc) · 2.31 KB
/
action.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
name: 'Slack Notify'
description: 'This action will send a notification to Slack'
author: 'rtCamp'
runs:
using: 'composite'
steps:
- name: "Slack-Markdown Message Conversion"
if: env.SLACKIFY_MARKDOWN == 'true' && env.SLACK_MESSAGE != ''
id: slackify_message
uses: LoveToKnow/slackify-markdown-action@v1
with:
text: '${{ env.SLACK_MESSAGE }}'
- name: "Slack-Markdown Success Message Conversion"
if: env.SLACKIFY_MARKDOWN == 'true' && env.SLACK_MESSAGE_ON_SUCCESS != ''
id: slackify_success_message
uses: LoveToKnow/slackify-markdown-action@v1
with:
text: '${{ env.SLACK_MESSAGE_ON_SUCCESS }}'
- name: "Slack-Markdown Failure Message Conversion"
if: env.SLACKIFY_MARKDOWN == 'true' && env.SLACK_MESSAGE_ON_FAILURE != ''
id: slackify_failure_message
uses: LoveToKnow/slackify-markdown-action@v1
with:
text: '${{ env.SLACK_MESSAGE_ON_FAILURE }}'
- name: "Slack-Markdown Cancel Message Conversion"
if: env.SLACKIFY_MARKDOWN == 'true' && env.SLACK_MESSAGE_ON_CANCEL != ''
id: slackify_cancel_message
uses: LoveToKnow/slackify-markdown-action@v1
with:
text: '${{ env.SLACK_MESSAGE_ON_CANCEL }}'
- name: "Slack Notification (Formatted)"
if: env.SLACKIFY_MARKDOWN == 'true'
env:
SLACK_MESSAGE: "${{ steps.slackify_message.outputs.text || env.SLACK_MESSAGE }}"
SLACK_MESSAGE_ON_SUCCESS: "${{ steps.slackify_success_message.outputs.text || env.SLACK_MESSAGE_ON_SUCCESS }}"
SLACK_MESSAGE_ON_FAILURE: "${{ steps.slackify_failure_message.outputs.text || env.SLACK_MESSAGE_ON_FAILURE }}"
SLACK_MESSAGE_ON_CANCEL: "${{ steps.slackify_cancel_message.outputs.text || env.SLACK_MESSAGE_ON_CANCEL }}"
GITHUB_RUN: "${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}"
ENABLE_ESCAPES: "true"
uses: "docker://ghcr.io/rtcamp/action-slack-notify:v2.3.2"
- name: "Slack Notification (Unformatted)"
if: env.SLACKIFY_MARKDOWN != 'true'
uses: "docker://ghcr.io/rtcamp/action-slack-notify:v2.3.2"
env:
GITHUB_RUN: "${{ github.event.repository.html_url }}/actions/runs/${{ github.run_id }}"
branding:
icon: 'bell'
color: 'yellow'