From d7f0c8e891d89d6b5f756d7b4333d88d332b80fb Mon Sep 17 00:00:00 2001 From: seakee Date: Sat, 1 Aug 2026 10:58:44 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20ci:=20add=20stable=20required-ch?= =?UTF-8?q?eck=20gate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Aggregate the path-selected PR jobs into one required status check.\nAllow skipped jobs for unaffected paths while failing the aggregate on any failed or cancelled applicable check.\nThis keeps branch protection effective for docs-only and matrix-based pull requests. --- .github/workflows/pr-check.yml | 48 ++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/.github/workflows/pr-check.yml b/.github/workflows/pr-check.yml index 0b583840..09b91233 100644 --- a/.github/workflows/pr-check.yml +++ b/.github/workflows/pr-check.yml @@ -203,3 +203,51 @@ jobs: push: false build-args: | VERSION=ci + + required: + name: Required checks + needs: + - changes + - frontend + - manager-server + - manager-server-windows-sqlite + - native-control + - docker-build + if: always() + runs-on: ubuntu-latest + + steps: + - name: Verify applicable checks + env: + CHANGES_RESULT: ${{ needs.changes.result }} + FRONTEND_RESULT: ${{ needs.frontend.result }} + MANAGER_SERVER_RESULT: ${{ needs['manager-server'].result }} + WINDOWS_SQLITE_RESULT: ${{ needs['manager-server-windows-sqlite'].result }} + NATIVE_CONTROL_RESULT: ${{ needs['native-control'].result }} + DOCKER_BUILD_RESULT: ${{ needs['docker-build'].result }} + shell: bash + run: | + set -euo pipefail + + results=( + "Scope:${CHANGES_RESULT}" + "Frontend:${FRONTEND_RESULT}" + "Manager Server:${MANAGER_SERVER_RESULT}" + "Manager Server SQLite (Windows):${WINDOWS_SQLITE_RESULT}" + "Native Control:${NATIVE_CONTROL_RESULT}" + "Docker Build:${DOCKER_BUILD_RESULT}" + ) + + for check in "${results[@]}"; do + name="${check%%:*}" + result="${check#*:}" + case "${result}" in + success|skipped) + echo "${name}: ${result}" + ;; + *) + echo "${name} did not complete successfully: ${result:-missing}" >&2 + exit 1 + ;; + esac + done