File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change 1
1
---
2
2
name : Slack alert
3
- description : Send an alert to a Slack channel
3
+ description : Send an alert to a Slack channel using workflow builder
4
4
inputs :
5
5
inputs :
6
6
description : Textual representation of workflow inputs
@@ -17,6 +17,16 @@ inputs:
17
17
required : false
18
18
default : " N/A"
19
19
type : string
20
+ # Typically this would be a secret.
21
+ slack-webhook-url :
22
+ description : Slack workflow builder webhook URL
23
+ required : true
24
+ type : string
25
+ # Typically this would be a secret or variable.
26
+ slack-channel-id :
27
+ description : ID of Slack channel to send alert to
28
+ required : true
29
+ type : string
20
30
runs :
21
31
using : composite
22
32
steps :
32
42
"workflow-url": "${{ env.WORKFLOW_URL }}"
33
43
}
34
44
env :
35
- SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
36
- SLACK_CHANNEL_ID : ${{ vars.SLACK_CHANNEL_ID }}
45
+ SLACK_WEBHOOK_URL : ${{ inputs.slack-webhook-url }}
46
+ SLACK_CHANNEL_ID : ${{ inputs.slack-channel-id }}
37
47
INPUTS : ${{ inputs.inputs }}
38
48
MESSAGE : ${{ inputs.message }}
39
49
RESULTS_URL : ${{ inputs.results-url }}
Original file line number Diff line number Diff line change @@ -117,5 +117,8 @@ jobs:
117
117
run : terraform apply -auto-approve -input=false
118
118
119
119
- name : Send message to Slack via Workflow Builder
120
- uses : .github/actions/slack-alert
120
+ uses : ./.github/actions/slack-alert
121
+ with :
122
+ slack-webhook-url : ${{ secrets.SLACK_WEBHOOK_URL }}
123
+ slack-channel-id : ${{ vars.SLACK_CHANNEL_ID }}
121
124
if : failure()
You can’t perform that action at this time.
0 commit comments