-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (75 loc) · 2.94 KB
/
job-00-generic-notification.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
---
name: job-00-generic-notification
# Consuming Projects Must Implement:
# - ./.github/scripts/step-setup-environment.sh
on:
workflow_call:
inputs:
FORCE_HALT_WORKFLOW:
default: false
description: "Optional, allows you to use the notification to halt the workflow."
required: false
type: string
NOTIFICATION_EMOJI:
default: ":heavy_check_mark:"
description: "Optional, allows you to specify a notification emoji for your notification platform."
required: false
type: string
NOTIFICATION_EMOJI_FAILURE:
default: ":x:"
description: "Optional, allows you to specify a notification emoji for your notification platform."
required: false
type: string
NOTIFICATION_MESSAGE:
description: "The message that will sent as a notification, in the event the job succeeds."
required: true
type: string
NOTIFICATION_MESSAGE_FAILURE:
default: "there was an error reporting the workflow's status!"
description: "The message that will sent as a notification, in the event the job fails."
required: false
type: string
REMOTE_SCRIPT_NOTIFICATION:
default: "ci/notifications/scripts/slack.sh"
description: "Optional, allows you to specify a notification script."
required: false
type: string
TESTING_MODE:
default: false
description: "Optional, allows you to test a workflow failure."
required: false
type: boolean
WORKFLOW_NAME:
default: ""
description: "Identifies this workflow in notifications."
required: false
type: string
secrets:
SLACK_WEBHOOK:
description: "Optional, enables Slack notifications."
required: false
jobs:
send_notification:
runs-on: ubuntu-latest
steps:
- name: Notification -- Checkout Repository
uses: actions/checkout@v4
- name: Notification -- Setup Environment
env:
WORKFLOW_NAME: ${{ inputs.WORKFLOW_NAME }}
run: |
bash "./.github/scripts/step-setup-environment.sh"
shell: bash
- name: Notification -- Install Toolbox
uses: ./.github/actions/action-00-toolbox
- name: Notification -- Run Notification Action
uses: ./.cicd-tools/boxes/active/ci/github/actions/action-00-generic-notification
with:
FORCE_HALT_WORKFLOW: ${{ inputs.FORCE_HALT_WORKFLOW }}
NOTIFICATION_EMOJI: ${{ inputs.NOTIFICATION_EMOJI }}
NOTIFICATION_EMOJI_FAILURE: ${{ inputs.NOTIFICATION_EMOJI_FAILURE }}
NOTIFICATION_MESSAGE: ${{ inputs.NOTIFICATION_MESSAGE }}
NOTIFICATION_MESSAGE_FAILURE: ${{ inputs.NOTIFICATION_MESSAGE_FAILURE }}
NOTIFICATION_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK }}
REMOTE_SCRIPT_NOTIFICATION: ${{ inputs.REMOTE_SCRIPT_NOTIFICATION }}
TESTING_MODE: ${{ inputs.TESTING_MODE }}