diff --git a/.github/UPDATE-PRS.md b/.github/UPDATE-PRS.md index 3b24dfa..6c9bc37 100644 --- a/.github/UPDATE-PRS.md +++ b/.github/UPDATE-PRS.md @@ -33,7 +33,12 @@ the key in App settings and replace the Actions secret if it is compromised. No branch-protection bypass is needed or recommended. Ensure repository/organization policy allows this App and GitHub Actions. -Protect `master` with your desired required checks and reviews. Permit force +Protect `master` with a branch ruleset requiring pull requests and the **CI passed** +status check (source: GitHub Actions). This gate requires the updater tests, both +flake checks, matrix discovery, and all package builds to succeed; failed, +cancelled, or skipped prerequisites fail the gate. Run CI once if the check is +not yet available in the ruleset picker. Individual matrix checks need not be +required separately. Add any desired review requirements. Permit force pushes to the unprotected `automation/flake-*/` branches; refreshes replace their generated commit. Consider dismissing stale approvals when a PR changes. There is no automatic merge. diff --git a/.github/workflows/flake-check.yml b/.github/workflows/flake-check.yml index c6294d5..f613cdc 100644 --- a/.github/workflows/flake-check.yml +++ b/.github/workflows/flake-check.yml @@ -12,6 +12,28 @@ permissions: contents: read jobs: + ci-passed: + name: CI passed + runs-on: ubuntu-latest + needs: [updater-tests, check, discover, builds] + # Run even if a prerequisite fails or is skipped; a skipped gate must not + # accidentally satisfy the branch ruleset's required status check. + if: ${{ always() }} + steps: + - name: Require every CI job to succeed + env: + RESULTS: ${{ toJSON(needs.*.result) }} + run: | + python3 - <<'PY' + import json + import os + import sys + + results = json.loads(os.environ["RESULTS"]) + print(f"CI job results: {results}") + sys.exit(0 if results and all(result == "success" for result in results) else 1) + PY + updater-tests: runs-on: ubuntu-latest steps: