You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .github/actions/notify-slack/action.yml
+24-16Lines changed: 24 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ inputs:
6
6
required: true
7
7
type: string
8
8
PRIORITY:
9
-
description: 'Priority level of the alert (medium/high)'
9
+
description: 'Priority level of the alert (medium/high/test)'
10
10
required: true
11
11
type: string
12
12
STEP:
@@ -31,19 +31,29 @@ runs:
31
31
id: alert_message
32
32
shell: bash
33
33
run: |
34
-
if [[ "${{ inputs.PRIORITY }}" == "high" ]]; then
35
-
if [[ -n "${{ inputs.STEP }}" ]]; then
36
-
message="🚨 High Priority Alert: [${{ github.workflow }}] failed at step \"${{ inputs.STEP }}\". Immediate attention is required to avoid production impact."
37
-
else
38
-
message="🚨 High Priority Alert: [${{ github.workflow }}] failed. Immediate attention is required to avoid production impact."
39
-
fi
40
-
else
41
-
if [[ -n "${{ inputs.STEP }}" ]]; then
42
-
message="🚧 Medium Priority Alert: [${{ github.workflow }}] encountered an issue at step \"${{ inputs.STEP }}\". This may affect ongoing integration processes."
43
-
else
44
-
message="🚧 Medium Priority Alert: [${{ github.workflow }}] encountered an issue. This may affect ongoing integration processes."
45
-
fi
46
-
fi
34
+
case "${{ inputs.PRIORITY }}" in
35
+
high)
36
+
if [[ -n "${{ inputs.STEP }}" ]]; then
37
+
message="🚨 High Priority Alert: [${{ github.workflow }}] failed at step \"${{ inputs.STEP }}\". Immediate attention is required to avoid production impact."
38
+
else
39
+
message="🚨 High Priority Alert: [${{ github.workflow }}] failed. Immediate attention is required to avoid production impact."
40
+
fi
41
+
;;
42
+
test)
43
+
if [[ -n "${{ inputs.STEP }}" ]]; then
44
+
message="🧪 Test Alert: [${{ github.workflow }}] reached step \"${{ inputs.STEP }}\". This is a test notification only."
45
+
else
46
+
message="🧪 Test Alert: [${{ github.workflow }}]. This is a test notification only."
47
+
fi
48
+
;;
49
+
*)
50
+
if [[ -n "${{ inputs.STEP }}" ]]; then
51
+
message="🚧 Medium Priority Alert: [${{ github.workflow }}] encountered an issue at step \"${{ inputs.STEP }}\". This may affect ongoing integration processes."
52
+
else
53
+
message="🚧 Medium Priority Alert: [${{ github.workflow }}] encountered an issue. This may affect ongoing integration processes."
54
+
fi
55
+
;;
56
+
esac
47
57
48
58
# Construct the JSON payload and save it to a file
0 commit comments