From 9d7e1ccc41aa5efc594ec8dae3777d04dc0f8c98 Mon Sep 17 00:00:00 2001 From: Opeyemi Date: Tue, 5 Mar 2024 21:14:50 +0100 Subject: [PATCH] update failure stpes (#3870) --- .github/workflows/build.yml | 33 +++---------------- .../workflows/container-registry-purge.yml | 15 +++------ 2 files changed, 9 insertions(+), 39 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index eff4695cfd..fa74ead1bb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -540,36 +540,11 @@ jobs: steps: - name: Check if any job failed if: | - github.ref == 'refs/heads/main' + (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/rc' - || github.ref == 'refs/heads/hotfix-rc' - env: - LINT_STATUS: ${{ needs.lint.result }} - TESTING_STATUS: ${{ needs.testing.result }} - BUILD_ARTIFACTS_STATUS: ${{ needs.build-artifacts.result }} - BUILD_DOCKER_STATUS: ${{ needs.build-docker.result }} - UPLOAD_STATUS: ${{ needs.upload.result }} - BUILD_MSSQLMIGRATORUTILITY_STATUS: ${{ needs.build-mssqlmigratorutility.result }} - TRIGGER_SELF_HOST_BUILD_STATUS: ${{ needs.self-host-build.result }} - TRIGGER_K8S_DEPLOY_STATUS: ${{ needs.trigger-k8s-deploy.result }} - run: | - if [ "$LINT_STATUS" = "failure" ]; then - exit 1 - elif [ "$TESTING_STATUS" = "failure" ]; then - exit 1 - elif [ "$BUILD_ARTIFACTS_STATUS" = "failure" ]; then - exit 1 - elif [ "$BUILD_DOCKER_STATUS" = "failure" ]; then - exit 1 - elif [ "$UPLOAD_STATUS" = "failure" ]; then - exit 1 - elif [ "$BUILD_MSSQLMIGRATORUTILITY_STATUS" = "failure" ]; then - exit 1 - elif [ "$TRIGGER_SELF_HOST_BUILD_STATUS" = "failure" ]; then - exit 1 - elif [ "$TRIGGER_K8S_DEPLOY_STATUS" = "failure" ]; then - exit 1 - fi + || github.ref == 'refs/heads/hotfix-rc') + && contains(needs.*.result, 'failure') + run: exit 1 - name: Log in to Azure - CI subscription uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 diff --git a/.github/workflows/container-registry-purge.yml b/.github/workflows/container-registry-purge.yml index 4b61e59125..550096d1a7 100644 --- a/.github/workflows/container-registry-purge.yml +++ b/.github/workflows/container-registry-purge.yml @@ -69,20 +69,15 @@ jobs: name: Check for failures if: always() runs-on: ubuntu-22.04 - needs: - - purge + needs: [purge] steps: - name: Check if any job failed if: | - github.ref == 'refs/heads/main' + (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/rc' - || github.ref == 'refs/heads/hotfix-rc' - env: - PURGE_STATUS: ${{ needs.purge.result }} - run: | - if [ "$PURGE_STATUS" = "failure" ]; then - exit 1 - fi + || github.ref == 'refs/heads/hotfix-rc') + && contains(needs.*.result, 'failure') + run: exit 1 - name: Log in to Azure - CI subscription uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7