From e707669f3ab70e3f196e11048da3b7af3e6d4b24 Mon Sep 17 00:00:00 2001 From: croc100 Date: Mon, 8 Jun 2026 20:03:01 +0900 Subject: [PATCH] ci: add always-green wrapper job for branch protection compatibility Docs-only PRs skip all conditional jobs (lint, test, etc.) via paths-filter, which leaves required status checks in 'skipping' state. GitHub treats skipped != passed, so merge is blocked. Fix: add a ci wrapper job that depends on all conditional jobs and runs with if: always(). It passes when deps are either passed or skipped, and fails when any dep fails or is cancelled. Branch protection ruleset updated to require only 'ci' instead of 'test (3.10/11/12)'. --- .github/workflows/ci.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d1f64c9..8a5d1ca 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -225,6 +225,23 @@ jobs: TEST_DATABASE_URL: oracle+oracledb://mrt:mrt@localhost:1521/?service_name=FREEPDB1 run: coverage run -m pytest tests/test_oracle.py -v + # Always-green wrapper — the only job registered as a required status check. + # Succeeds when all conditional jobs either passed or were skipped (docs-only + # PRs skip everything, but this job still reports green so the PR can merge). + ci: + needs: [lint, test, test-django, test-postgres, test-mysql, test-oracle, test-mssql] + if: always() + runs-on: ubuntu-latest + steps: + - name: Check all jobs passed or were skipped + run: | + results='${{ toJSON(needs.*.result) }}' + if echo "$results" | grep -qE '"failure"|"cancelled"'; then + echo "One or more required jobs failed or were cancelled." + exit 1 + fi + echo "All jobs passed or were skipped." + test-mssql: needs: changes if: ${{ needs.changes.outputs.src == 'true' || needs.changes.outputs.mssql == 'true' || needs.changes.outputs.ci == 'true' }}