From cf2136ea2c28d9854f79e96b43ae653b16a170b9 Mon Sep 17 00:00:00 2001 From: Kyle Sexton <153232337+kyle-sexton@users.noreply.github.com> Date: Wed, 18 Nov 2026 15:12:53 -0500 Subject: [PATCH] ci: run ci-status through the report-ci-status composite Replace the inline check-contract and aggregate-results steps with ci-workflows' report-ci-status composite (v0.76.0) and a "Fail on the contract or draft policy" step that fails on any outcome other than success. Behavior is kept: draft allow, treat-skipped-as fail, no exempt authors, sibling re-runs on, no yield wait. The composite step keeps the name "Aggregate lane results" so a contract-only run still finds the writer step of a full run recorded before this change. Concurrency already falls back to github.run_id for a push. Refs melodic-software/ci-workflows#1138 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01Vcupoo79EqmECYFZ4MTv6C --- .github/workflows/pr-require-checks.yml | 60 +++++++++++++------------ 1 file changed, 32 insertions(+), 28 deletions(-) diff --git a/.github/workflows/pr-require-checks.yml b/.github/workflows/pr-require-checks.yml index 393a202..02e8203 100644 --- a/.github/workflows/pr-require-checks.yml +++ b/.github/workflows/pr-require-checks.yml @@ -110,9 +110,9 @@ jobs: needs: [validate-marketplace, lychee] if: ${{ !cancelled() }} runs-on: ubuntu-24.04 - # No run waits for another: with `yield-to-full-run` a contract-only run - # lists in-flight runs once and reads the status once, and a full run's - # ci-status runs after its lanes, so either finishes in seconds. + # No run waits for another: a contract-only run lists in-flight runs once + # and reads the status once, and a full run's ci-status runs after its + # lanes, so either finishes in seconds. timeout-minutes: 3 permissions: contents: read @@ -121,33 +121,37 @@ jobs: # branch reads back on the next contract-only event. pull-requests: write statuses: write - # `yield-to-full-run` lists this workflow's runs on the head SHA, and - # `rerun-contract-only-siblings` re-runs the red contract-only ones once - # the full run records `success`. Under an explicit `permissions:` block - # every unlisted scope defaults to none; write covers the read. + # The composite lists this workflow's runs on the head SHA (its fixed + # `yield-to-full-run`) and re-runs the red contract-only ones once the + # full run records `success` (`rerun-contract-only-siblings`). Under an + # explicit `permissions:` block every unlisted scope defaults to none; + # write covers the read. actions: write steps: - - name: Check the pull-request contract - uses: melodic-software/ci-workflows/.github/actions/pr-require-checks/check-contract@24067add42f5fa04743c587c6a22aa7d4059e7b8 # v0.75.0 - with: - token: ${{ github.token }} + # The contract, the draft policy and the aggregation in one step. The + # step keeps the aggregation step's old name: a contract-only run finds + # the writer step of the full run it carries forward by this name. + # The composite fixes `yield-to-full-run: 'true'` and + # `carry-forward-wait-seconds: '0'`, the values this job set before + # (https://github.com/melodic-software/ci-workflows/blob/ebd0e3bed99ae1365fcb4ef47ce97cfa745fcf2f/.github/actions/pr-require-checks/report-ci-status/action.yml#L128-L129): + # a contract-only run never waits; while a full run on the SHA is in + # flight it fails with "superseded by full run ", and once that run + # records `success` it re-runs the red contract-only runs + # (`rerun-contract-only-siblings`, default `true`). `treat-skipped-as` + # stays at its default `fail`, as before: a skipped lane is red. - name: Aggregate lane results - # `!cancelled()` so a failing check-contract step does not skip the - # aggregation: the job still fails on the contract step's exit code, and - # the `ci-lanes` status is on the SHA for the next contract-only run. - if: ${{ !cancelled() }} - uses: melodic-software/ci-workflows/.github/actions/pr-require-checks/aggregate-results@24067add42f5fa04743c587c6a22aa7d4059e7b8 # v0.75.0 + id: report + uses: melodic-software/ci-workflows/.github/actions/pr-require-checks/report-ci-status@ebd0e3bed99ae1365fcb4ef47ce97cfa745fcf2f # v0.76.0 with: - # A contract-only run never waits: while a full run on the SHA is in - # flight it fails with "superseded by full run ", and that run's - # newer ci-status decides the gate. Once the full run records - # `success` it re-runs those red contract-only runs, which then read - # the `success` and replace their red check runs. - yield-to-full-run: 'true' - rerun-contract-only-siblings: 'true' - carry-forward-wait-seconds: '0' + step-name: Aggregate lane results results: ${{ join(needs.*.result, ' ') }} - # The replaced inline aggregator passed only `success`, so a `skipped` - # lane was already red here. - treat-skipped-as: fail - token: ${{ github.token }} + # This workflow is not draft-gated (no `ready_for_review` trigger), so a draft passes. + draft: allow + # The composite's step concludes on the lanes alone; the contract and + # draft results fail the job here. Anything but `success` fails, so an + # empty or renamed output fails closed. + - name: Fail on the contract or draft policy + if: ${{ !cancelled() && (steps.report.outputs.contract != 'success' || steps.report.outputs.draft != 'success') }} + run: | + echo "::error::ci-status: the pull-request contract or the draft policy failed; see the step above." + exit 1