From 55ac31470a9810c40f591391123c29814c758121 Mon Sep 17 00:00:00 2001 From: Jonathan Giannuzzi Date: Fri, 11 Aug 2023 19:45:02 +0100 Subject: [PATCH] Fix "All required checks done" CI job to never be skipped (#288) --- .github/workflows/ci.yml | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 94d2a35e..52b94c22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -28,11 +28,19 @@ jobs: # Virtual job that can be configured as a required check before a PR can be merged. all-required-checks-done: name: All required checks done + if: ${{ always() }} needs: - lint - test - codeql runs-on: ubuntu-22.04 steps: - - run: | - echo "All required checks done" + - uses: actions/github-script@v6 + with: + script: | + const results = ${{ toJSON(needs.*.result) }}; + if (results.every(res => res === 'success')) { + core.info('All required checks succeeded'); + } else { + core.setFailed('Some required checks failed'); + }