feat(ci): label PRs with the Codex review verdict (#2360)

The review outcome was only visible by opening the PR and reading the body.
Each published review now sets exactly one verdict label:
codex-review:pass (all stages pass, no Blocker/Major findings; Minor/Nit
are advisory), codex-review:changes, or codex-review:clarify. A review of
new inputs clears the previous verdict first, so a stale pass never
outlives the commit it described, and a failed run on current inputs is
marked codex-review:error. Other labels are left alone.

The review body now opens with the verdict and finding counts. Label API
failures only warn; they never fail or block the published review.
This commit is contained in:
weishu
2026-11-10 15:31:35 +08:00
committed by GitHub
parent bfec91b5e1
commit 1bcebb7664
3 changed files with 226 additions and 6 deletions
+11
View File
@@ -83,3 +83,14 @@ jobs:
script: |
const { publishReview } = require('./.github/scripts/pr-review.cjs');
await publishReview({ github, context, core });
# Cancelled runs are superseded by a newer run, which owns the label.
- name: Mark a failed review
if: failure() && steps.prepare.outputs.should_review == 'true'
uses: actions/github-script@v7
env:
REVIEW_CONTEXT_PATH: ${{ steps.prepare.outputs.context_path }}
with:
script: |
const { markReviewError } = require('./.github/scripts/pr-review.cjs');
await markReviewError({ github, context, core });