diff --git a/.github/workflows/base-image.yaml b/.github/workflows/base-image.yaml index ac6ea28a..24b0414f 100644 --- a/.github/workflows/base-image.yaml +++ b/.github/workflows/base-image.yaml @@ -43,3 +43,16 @@ jobs: push: true tags: ${{ steps.metadata.outputs.tags }} labels: ${{ steps.metadata.outputs.labels }} + + report-failure: + name: Report failure in workflow + runs-on: ubuntu-latest + needs: build-base-image + 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 "automation" --workflowName "${{ github.workflow }}" --workflowRunNum "${{ github.run_id }}" --ref "${{ env.BRANCH }}" --hook "${{ env.SLACK_WEBHOOK }}" diff --git a/.github/workflows/build-automation.yaml b/.github/workflows/build-automation.yaml index bccf78be..41a500ad 100644 --- a/.github/workflows/build-automation.yaml +++ b/.github/workflows/build-automation.yaml @@ -318,3 +318,16 @@ jobs: push: true tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} + + report-failure: + name: Report failure in workflow + runs-on: ubuntu-latest + needs: [build-gpg-image, build-kubectl-image, build-argocdcli-image, build-gitcli-image, build-openapi-image, build-swagger-image, build-openjdk17-ibm-gradle-image] + 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 "automation" --workflowName "${{ github.workflow }}" --workflowRunNum "${{ github.run_id }}" --ref "${{ env.BRANCH }}" --hook "${{ env.SLACK_WEBHOOK }}" diff --git a/.github/workflows/build-helm.yaml b/.github/workflows/build-helm.yaml index 0504d5db..5dd41d3d 100644 --- a/.github/workflows/build-helm.yaml +++ b/.github/workflows/build-helm.yaml @@ -47,4 +47,17 @@ jobs: - name: Test ecosystem1 run: | - helm test main-ecosystem --namespace=galasa-ecosystem1 --kubeconfig $HOME/.kube/config \ No newline at end of file + helm test main-ecosystem --namespace=galasa-ecosystem1 --kubeconfig $HOME/.kube/config + + report-failure: + name: Report failure in workflow + runs-on: ubuntu-latest + needs: build-helm + 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 "automation" --workflowName "${{ github.workflow }}" --workflowRunNum "${{ github.run_id }}" --ref "${{ env.BRANCH }}" --hook "${{ env.SLACK_WEBHOOK }}" \ No newline at end of file