From b28b1a96d063d094a79d6a69b73a20d4f49e7c86 Mon Sep 17 00:00:00 2001 From: Yasunobu <42543015+P4suta@users.noreply.github.com> Date: Sat, 26 Sep 2026 02:31:35 +0900 Subject: [PATCH] ci: add the required aggregate job Branch protection requires one check, `required`, in every repository; it passes only when the jobs it needs succeeded or were skipped. --- .github/workflows/ci.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 81e4c0b..e9a3fd5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -132,3 +132,21 @@ jobs: steps: - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') run: exit 1 + + # The one status check branch protection requires, + # named the same in every P4suta repository. + # It passes only when every job it needs succeeded or was skipped. + required: + name: required + if: always() + needs: [ci-required] + runs-on: ubuntu-latest + timeout-minutes: 5 + permissions: {} + steps: + - name: Fail unless every needed job succeeded or was skipped + env: + RESULTS: ${{ toJSON(needs.*.result) }} + run: | + echo "${RESULTS}" + jq -e 'all(.[]; IN("success", "skipped"))' <<< "${RESULTS}"