From 44385d2948de760c6ca2b4a89bf17d5b3c852db9 Mon Sep 17 00:00:00 2001 From: Derek Roberts Date: Mon, 25 Nov 2024 09:26:16 -0800 Subject: [PATCH] Add PR Results gate to workflow --- .github/workflows/pr-open.yml | 10 ++++++++++ .github/workflows/pr-validate.yml | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-open.yml b/.github/workflows/pr-open.yml index aa64e7b68..333d4433c 100644 --- a/.github/workflows/pr-open.yml +++ b/.github/workflows/pr-open.yml @@ -576,3 +576,13 @@ jobs: oc login --token=${{ secrets.OC_TOKEN }} --server=${{ secrets.OC_SERVER }} oc project ${{ secrets.OC_NAMESPACE }} # Safeguard! oc scale dc/nr-forest-client-${{ github.event.number }}-legacy --replicas=1 + + results: + name: PR Results + needs: [builds, pre-tools, deploy-tools, deploy, cypress-run, scale-down-after, recreate-database, scale-up-legacy] + if: always() + runs-on: ubuntu-24.04 + steps: + - if: contains(needs.*.result, 'failure') + run: echo "At least one job has failed." && exit 1 + - run: echo "Success!" diff --git a/.github/workflows/pr-validate.yml b/.github/workflows/pr-validate.yml index f1054b959..9d3759c7d 100644 --- a/.github/workflows/pr-validate.yml +++ b/.github/workflows/pr-validate.yml @@ -73,6 +73,9 @@ jobs: results: name: Validate Results needs: [changelog, validate] + if: always() runs-on: ubuntu-24.04 steps: - - run: echo "Workflow completed successfully!" + - if: contains(needs.*.result, 'failure') + run: echo "At least one job has failed." && exit 1 + - run: echo "Success!"