Skip to content

Commit 8b3cf22

Browse files
committed
Post Slack message when host image build fails
Given these builds are now automatic, we need to be alerted whne they fail.
1 parent 80e8c76 commit 8b3cf22

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

.github/workflows/overcloud-host-image-build.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,3 +390,25 @@ jobs:
390390
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
391391
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}
392392
if: always()
393+
394+
- name: Send message to Slack via Workflow Builder
395+
uses: slackapi/[email protected]
396+
with:
397+
payload: |
398+
{
399+
"channel-id": "${{ env.SLACK_CHANNEL_ID }}",
400+
"inputs": "${{ env.INPUTS }}",
401+
"message": "${{ env.MESSAGE }}",
402+
"results-url": "${{ env.RESULTS_URL }}",
403+
"workflow-url": "${{ env.WORKFLOW_URL }}"
404+
}
405+
env:
406+
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
407+
# #release-train-alerts
408+
SLACK_CHANNEL_ID: C03B28HRP53
409+
INPUTS: >-
410+
branch: ${{ github.ref_name }}
411+
MESSAGE: "SKC overcloud host image build failed :sob:"
412+
RESULTS_URL: "N/A"
413+
WORKFLOW_URL: "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
414+
if: failure()

0 commit comments

Comments
 (0)