Skip to content

Commit 1feaca5

Browse files
committed
ci: add a single gate check for main to require
main has no required status checks, so GitHub auto-merge has nothing to wait for: `gh pr merge --auto` merged #1509 while its CI was still running, and renovate's platformAutomerge would merge dependency PRs the same way. Requiring the existing checks directly does not work, because everything behind `changes` is skipped on docs-only pull requests and a skipped check never satisfies a requirement. This adds the usual aggregator instead: it needs every job action-timeline already waits for, treats skipped as fine, and fails only when a job failed or was cancelled. That single "ci gate" check is what main's ruleset can require.
1 parent b184bdc commit 1feaca5

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

‎.github/workflows/ci.yaml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -544,3 +544,30 @@ jobs:
544544
runs-on: ubuntu-slim
545545
steps:
546546
- uses: Kesin11/actions-timeline@7bf79990b7c09f5dfb570ac30b814ca597bd538e # v3.1.1
547+
548+
# Single check for main's branch ruleset to require. Most jobs above are gated
549+
# on `changes` and are skipped on docs-only pull requests, so requiring them
550+
# individually would leave those pull requests blocked on checks that never
551+
# report. A skipped job is fine here; only real failures fail the gate.
552+
ci-gate:
553+
name: ci gate
554+
needs:
555+
- changes
556+
- tirith-scan
557+
- tirith-sarif-upload
558+
- preflight
559+
- test
560+
- build-native-packages
561+
- npm-publish-dry-run-and-upload-pkg-pr-now
562+
- ccusage-preview-e2e
563+
- ccusage-perf-comment
564+
if: ${{ always() }}
565+
runs-on: ubuntu-slim
566+
steps:
567+
- name: Report job results
568+
env:
569+
RESULTS: ${{ join(needs.*.result, ' ') }}
570+
run: echo "$RESULTS"
571+
- name: Fail when a job failed or was cancelled
572+
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
573+
run: exit 1

0 commit comments

Comments
 (0)