From 4843cd3a2301fef658c99f18f98bbdf1db27db56 Mon Sep 17 00:00:00 2001 From: Daniel Juenger <2955913+sleeepyjack@users.noreply.github.com> Date: Fri, 10 Nov 2023 22:42:19 +0000 Subject: [PATCH] Check status of precursor jobs --- .github/workflows/pr.yml | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index b746cf966..8169f03b3 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -86,11 +86,20 @@ jobs: # This job is the final job that runs after all other jobs and is used for branch protection status checks. # See: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/collaborating-on-repositories-with-code-quality-features/about-status-checks + # https://github.com/orgs/community/discussions/26822#discussioncomment-5122101 ci-success: runs-on: ubuntu-latest name: CI success + if: ${{ always() }} # need to use always() instead of !cancelled() because skipped jobs count as success needs: - ci - verify-devcontainers steps: - - run: echo "CI success" \ No newline at end of file + - name: Check status of all precursor jobs + if: >- + ${{ + contains(needs.*.result, 'failure') + || contains(needs.*.result, 'cancelled') + || contains(needs.*.result, 'skipped') + }} + run: exit 1 \ No newline at end of file