File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -115,3 +115,23 @@ jobs:
115
115
- name : Terraform Apply
116
116
if : github.ref == 'refs/heads/main' && github.event_name == 'push'
117
117
run : terraform apply -auto-approve -input=false
118
+
119
+ - name : Send message to Slack via Workflow Builder
120
+
121
+ with :
122
+ payload : |
123
+ {
124
+ "channel-id": "${{ env.SLACK_CHANNEL_ID }}",
125
+ "inputs": "${{ env.INPUTS }}",
126
+ "message": "${{ env.MESSAGE }}",
127
+ "results-url": "${{ env.RESULTS_URL }}",
128
+ "workflow-url": "${{ env.WORKFLOW_URL }}"
129
+ }
130
+ env :
131
+ SLACK_WEBHOOK_URL : ${{ secrets.SLACK_WEBHOOK_URL }}
132
+ SLACK_CHANNEL_ID : ${{ vars.SLACK_CHANNEL_ID }}
133
+ INPUTS : " N/A"
134
+ MESSAGE : " ${{ github.workflow }}/${{ github.job }} GitHub Actions workflow failed :sob:"
135
+ RESULTS_URL : " N/A"
136
+ WORKFLOW_URL : " ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
137
+ if : failure() && github.ref == 'refs/heads/main' && github.event_name == 'push'
You can’t perform that action at this time.
0 commit comments