Skip to content

Commit

Permalink
add failed build report to end of workflows
Browse files Browse the repository at this point in the history
Signed-off-by: Jade Carino <[email protected]>
  • Loading branch information
jadecarino committed Sep 27, 2024
1 parent fd8a908 commit baaa5af
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .github/workflows/base-image.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
13 changes: 13 additions & 0 deletions .github/workflows/build-automation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
15 changes: 14 additions & 1 deletion .github/workflows/build-helm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,17 @@ jobs:
- name: Test ecosystem1
run: |
helm test main-ecosystem --namespace=galasa-ecosystem1 --kubeconfig $HOME/.kube/config
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 }}"

0 comments on commit baaa5af

Please sign in to comment.