From 5bc900e44089d5845338a3cb8ce1a3ac12177441 Mon Sep 17 00:00:00 2001 From: Dark Dragon Date: Mon, 5 Aug 2024 15:18:08 +0000 Subject: [PATCH] Add job to test if all build jobs succeeded This can be used as required status for branch protection rules. --- .github/workflows/pull_request.yaml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/pull_request.yaml b/.github/workflows/pull_request.yaml index 681e01b7f..b6068a60b 100644 --- a/.github/workflows/pull_request.yaml +++ b/.github/workflows/pull_request.yaml @@ -10,3 +10,17 @@ concurrency: jobs: build: uses: ./.github/workflows/build.yaml + + # Check if all important jobs passed + # This can be used as required status for branch protection rules. + pr-ok: + runs-on: ubuntu-latest + needs: build + if: always() + steps: + - name: All tests ok + if: ${{ !(contains(needs.*.result, 'failure')) }} + run: exit 0 + - name: Some tests failed + if: ${{ contains(needs.*.result, 'failure') }} + run: exit 1