Skip to content

Commit 5c84337

Browse files
authored
Merge pull request #3 from NarrativeScience/QUALITY-1305/slack-perf-messages
allowing custom messages and channels for the slack recovery message
2 parents cd02427 + a1d6d19 commit 5c84337

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

src/commands/send-slack-on-workflow-recovery.yml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
11
description: Send a Slack message to a channel if the workflow has recovered
2+
parameters:
3+
channel:
4+
description: >
5+
The channel to send the slack notification to. Defaults to empty string which is the web-hooks default channel.
6+
type: string
7+
message:
8+
description: The message to send with the slack notification
9+
type: string
210
steps:
311
- run:
412
name: Check if the workflow has recovered
@@ -35,5 +43,6 @@ steps:
3543
include_project_field: false
3644
include_job_number_field: false
3745
include_visit_job_action: false
38-
message: ":tada: $WORKFLOW_LOCK_KEY has recovered!"
46+
channel: << parameters.channel >>
47+
message: << parameters.message >>
3948
color: "#1CBF43"

src/jobs/exit-queue.yml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ parameters:
44
description: If true, the default channel will be notified on workflow recovery
55
type: boolean
66
default: false
7+
channel:
8+
description: >
9+
The channel to send the slack notification to. Defaults to empty string which is the web-hooks default channel.
10+
type: string
11+
default: ""
12+
message:
13+
description: The message to send with the slack notification
14+
type: string
15+
default: ":tada: $WORKFLOW_LOCK_KEY has recovered!"
716
machine:
817
enabled: true
918
steps:
@@ -12,4 +21,7 @@ steps:
1221
- when:
1322
condition: << parameters.send_slack_on_recovery >>
1423
steps:
15-
- send-slack-on-workflow-recovery
24+
- send-slack-on-workflow-recovery:
25+
channel: << parameters.channel >>
26+
message: << parameters.message >>
27+

0 commit comments

Comments
 (0)