From ba34bdfb1dbfdf06ce117000ee8ff972a0a7becb Mon Sep 17 00:00:00 2001 From: Jade Carino Date: Fri, 27 Sep 2024 16:31:05 +0100 Subject: [PATCH] add report failed build job Signed-off-by: Jade Carino --- .github/workflows/build.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 715e2f4aa..8e136162f 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -168,4 +168,17 @@ jobs: env: GH_TOKEN: ${{ secrets.GALASA_TEAM_GITHUB_TOKEN }} run: | - gh workflow run build.yaml --repo https://github.com/galasa-dev/obr --ref ${{ env.BRANCH }} \ No newline at end of file + gh workflow run build.yaml --repo https://github.com/galasa-dev/obr --ref ${{ env.BRANCH }} + + report-failure: + name: Report failure in workflow + runs-on: ubuntu-latest + needs: [log-github-ref, build-managers, trigger-obr-workflow] + if: failure() + + steps: + - name: Report failure in workflow to Slack + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + run : | + docker run --rm -v ${{ github.workspace }}:/var/workspace ghcr.io/galasa-dev/galasabld-ibm:main slackpost workflows --repo "managers" --workflowName "${{ github.workflow }}" --workflowRunNum "${{ github.run_id }}" --ref "${{ env.BRANCH }}" --hook "${{ env.SLACK_WEBHOOK }}"