Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .github/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,14 @@
description: Trigger Claude Code automation
color: "b41d8f"

- name: claude:review:passed
description: Automated Claude PR review found no blocking issues on the current head commit
color: "0e8a16"

- name: claude:review:failed
description: Automated Claude PR review found blocking issues on the current head commit
color: "b60205"

- name: copilot
description: GitHub Copilot related
color: "e6dac6"
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/claude-code-automation-pr-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,49 @@ jobs:

Use `gh pr comment` with your Bash tool to leave your comprehensive review as a comment on the PR.

## Machine-Readable Verdict (MANDATORY)

After posting your review comment, you MUST emit a single-label verdict on the PR. This label is consumed by branch-protection rules to gate auto-merge — it is the only deterministic signal of your review outcome.

**Verdict criteria** (all must hold for PASS):

- No blocking findings under "CRITICAL CHECKS" — i.e. no missing test markers, no coverage drop below 85%, no `make lint` failures, no conventional-commit violations.
- No blocking architecture or security violations under "Repository-Specific Review Areas".
- Suggestions / nice-to-haves do NOT block the verdict.

If any blocking finding remains: verdict is **FAIL**.
Otherwise: verdict is **PASS**.

**Apply the label** (the two labels are mutually exclusive — always remove the opposite one):

```bash
# PASS:
gh pr edit ${{ github.event.pull_request.number }} \
--add-label "claude:review:passed" \
--remove-label "claude:review:failed"

# FAIL:
gh pr edit ${{ github.event.pull_request.number }} \
--add-label "claude:review:failed" \
--remove-label "claude:review:passed"
Comment on lines +232 to +241

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gh pr edit --add-label fails if the label does not already exist in the repo. Since labels-sync.yml only syncs labels on push to main, this PR’s own review run (and any runs before labels are created in repo settings) can error when trying to apply claude:review:passed/failed. To make the automation robust, add guidance/logic to ensure the labels exist first (e.g., create them if missing, or handle the “label not found” failure gracefully and still post the review).

Copilot uses AI. Check for mistakes.
```
Comment on lines +217 to +242

Copilot AI Apr 25, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Applying claude:review:* labels from within this workflow can retrigger the workflow because it listens to pull_request labeled events and the job condition stays true as long as the PR has the claude trigger label. That can cause at least one redundant extra Claude run per review (and potentially a loop if GitHub emits labeled even when --add-label is a no-op). Consider gating the job so it only runs on labeled events when github.event.label.name == 'claude', or remove labeled from the triggers and switch to a different trigger for starting the review.

Copilot uses AI. Check for mistakes.

Note: `--remove-label` is a no-op if the label is not present, so it is safe to always include it.

Also include the verdict as the final line of your sticky review comment, formatted exactly as:

```
**Verdict**: ✅ claude:review:passed
```

or

```
**Verdict**: ❌ claude:review:failed
```

This makes the verdict visible to humans without scrolling through all findings.

---

**Remember**: This is medical device software. Insist on highest standards. Be thorough, actionable, and kind.
Expand Down
Loading