From 0e31fbd782d0cb9a2b091938e3ca8c6788ca7ef2 Mon Sep 17 00:00:00 2001 From: "Leo J." <153937047+leiicamundi@users.noreply.github.com> Date: Wed, 5 Jun 2024 18:11:42 +0200 Subject: [PATCH 1/2] feat: report on slack in case of failure --- .github/workflows/build-images.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index 07a232fd..6256027d 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -457,6 +457,7 @@ jobs: - read-build-image-output - list-keycloak-versions - test-postgres-integ + - test-base-image steps: - name: Checkout uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4 @@ -530,3 +531,22 @@ jobs: if [ "$(./.github/scripts/utils/find_latest_keycloak.sh)" = "${{ matrix.keycloak_version }}" ]; then docker buildx imagetools create -t "${{ env.dockerhub_target_name }}:latest" "${{ env.keycloak_image_name }}" fi + + notify-on-failure: + runs-on: ubuntu-latest + if: always() && needs.publish-image.result == 'failure' || needs.read-build-image-output.result == 'failure' || needs.list-keycloak-versions.result == 'failure' || needs.test-postgres-integ.result == 'failure' || needs.test-base-image.result == 'failure' + needs: + - publish-image + - read-build-image-output + - list-keycloak-versions + - test-postgres-integ + - test-base-image + steps: + - name: Notify in Slack in case of failure + id: slack-notification + if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' + uses: camunda/infraex-common-config/.github/actions/report-failure-on-slack@feature/report-failure-action # TODO: change me to main when available + with: + vault_addr: ${{ secrets.VAULT_ADDR }} + vault_role_id: ${{ secrets.VAULT_ROLE_ID }} + vault_secret_id: ${{ secrets.VAULT_SECRET_ID }} From c53321d1c9fff634cb385c94ce195673137c171d Mon Sep 17 00:00:00 2001 From: "Leo J." <153937047+leiicamundi@users.noreply.github.com> Date: Thu, 6 Jun 2024 10:57:26 +0200 Subject: [PATCH 2/2] apply suggestions from pr --- .github/workflows/build-images.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-images.yml b/.github/workflows/build-images.yml index 6256027d..4064068d 100644 --- a/.github/workflows/build-images.yml +++ b/.github/workflows/build-images.yml @@ -534,7 +534,7 @@ jobs: notify-on-failure: runs-on: ubuntu-latest - if: always() && needs.publish-image.result == 'failure' || needs.read-build-image-output.result == 'failure' || needs.list-keycloak-versions.result == 'failure' || needs.test-postgres-integ.result == 'failure' || needs.test-base-image.result == 'failure' + if: failure() needs: - publish-image - read-build-image-output @@ -544,8 +544,8 @@ jobs: steps: - name: Notify in Slack in case of failure id: slack-notification - if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' - uses: camunda/infraex-common-config/.github/actions/report-failure-on-slack@feature/report-failure-action # TODO: change me to main when available + if: github.event_name == 'schedule' + uses: camunda/infraex-common-config/.github/actions/report-failure-on-slack@705df1af7d06626b8c6838f58123bb3bf84fc093 # main with: vault_addr: ${{ secrets.VAULT_ADDR }} vault_role_id: ${{ secrets.VAULT_ROLE_ID }}