diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ea69052..73eebe1 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -261,4 +261,16 @@ jobs: push: true tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} - \ No newline at end of file + + report-failure: + name: Report failure in workflow + runs-on: ubuntu-latest + needs: [build-push-galasabld, build-push-galasabld-ibm, build-push-openapi2beans, build-push-buildutils-executables] + 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 "buildutils" --workflowName "${{ github.workflow }}" --workflowRunNum "${{ github.run_id }}" --ref "${{ env.BRANCH }}" --hook "${{ env.SLACK_WEBHOOK }}"