From 5bd418225d4ad33c67a2ba3beedebdfaf0d524a4 Mon Sep 17 00:00:00 2001 From: Goooler Date: Sat, 15 Nov 2025 14:56:09 +0800 Subject: [PATCH] Add final-status for CI jobs - Syncs https://github.com/GradleUp/shadow/commit/da9c615867eaef9e703d220f70813ba30450d5d1. - Refs https://jakewharton.com/fan-in-to-a-single-required-github-action. --- .github/workflows/ci.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a4077fda23..001a9024aa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -103,3 +103,19 @@ jobs: check_name: JUnit ${{ matrix.kind }} ${{ matrix.jre }} ${{ matrix.os }} report_paths: '*/build/test-results/*/TEST-*.xml' check_retries: true + + # Status check that is required in branch protection rules. + final-status: + needs: + - build + runs-on: ubuntu-latest + if: always() + steps: + - name: Check + run: | + results=$(tr -d '\n' <<< '${{ toJSON(needs.*.result) }}') + if ! grep -q -v -E '(failure|cancelled)' <<< "$results"; then + echo "One or more required jobs failed" + exit 1 + fi + echo "All required jobs completed successfully."