File tree Expand file tree Collapse file tree 1 file changed +40
-0
lines changed
.github/actions/slack-alert Expand file tree Collapse file tree 1 file changed +40
-0
lines changed Original file line number Diff line number Diff line change
1
+ ---
2
+ name : Slack alert
3
+ description : Send an alert to a Slack channel
4
+ inputs :
5
+ inputs :
6
+ description : Textual representation of workflow inputs
7
+ required : false
8
+ default : " N/A"
9
+ type : string
10
+ message :
11
+ description : Alert message
12
+ required : false
13
+ default : " ${{ github.workflow }} GitHub Actions workflow failed :sob:"
14
+ type : string
15
+ results-url :
16
+ description : URL for workflow results
17
+ required : false
18
+ default : " N/A"
19
+ type : string
20
+ runs :
21
+ using : composite
22
+ steps :
23
+ - name : Send message to Slack via Workflow Builder
24
+
25
+ with :
26
+ payload : |
27
+ {
28
+ "channel-id": "${{ env.SLACK_CHANNEL_ID }}",
29
+ "inputs": "${{ env.INPUTS }}",
30
+ "message": "${{ env.MESSAGE }}",
31
+ "results-url": "${{ env.RESULTS_URL }}",
32
+ "workflow-url": "${{ env.WORKFLOW_URL }}"
33
+ }
34
+ env :
35
+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
36
+ SLACK_CHANNEL_ID : ${{ vars.SLACK_CHANNEL_ID }}
37
+ INPUTS : ${{ inputs.inputs }}
38
+ MESSAGE : ${{ inputs.message }}
39
+ RESULTS_URL : ${{ inputs.results-url }}
40
+ WORKFLOW_URL : " ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
You can’t perform that action at this time.
0 commit comments