From c56ca81e605b5b674608c609ca500b428c311142 Mon Sep 17 00:00:00 2001 From: Joseph Mearman Date: Sat, 12 Sep 2026 10:08:42 +0100 Subject: [PATCH] ci: add a Required Checks job aggregating commitlint, lint, and typecheck A single job that depends on every check meant to gate a merge and fails if any of them failed or was cancelled, so a branch ruleset can name one context instead of every real job individually. This is what lets a future job be added, renamed, or removed without also having to edit branch protection every time, and avoids a required-check list going stale if any of these jobs ever becomes conditional or a matrix. --- .github/workflows/ci.yml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e091ab2..e3fea92 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -57,6 +57,22 @@ jobs: - run: pnpm build - run: pnpm exec attw --pack + required-checks: + name: Required Checks + needs: [commitlint, lint, typecheck] + # Always runs, even if a dependency failed, so it can report that failure itself rather than being skipped -- a required check that's silently absent blocks a PR indefinitely instead of failing it visibly. + if: always() + runs-on: ubuntu-latest + timeout-minutes: 5 + steps: + - name: Fail if any required job failed or was cancelled + run: | + if [[ "${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}" == "true" ]]; then + echo "One or more required jobs did not succeed:" + echo '${{ toJSON(needs) }}' + exit 1 + fi + release: name: Release needs: [commitlint, lint, typecheck]