Skip to content

Release v1.7.1 — QoL bug-fix batch #1755

Release v1.7.1 — QoL bug-fix batch

Release v1.7.1 — QoL bug-fix batch #1755

name: Review Feedback Analysis
on:
issue_comment:
types: [created]
workflow_dispatch:
inputs:
pr_number:
description: 'PR number to analyze'
required: true
type: number
jobs:
analyze-feedback:
# Auto-trigger: only for claude[bot] code review comments on PRs
# Manual trigger: always run
# Skip: clean verdicts (clean-gate handles those) and issues-found verdicts
# (pipeline-triage.yml handles those with scorer + PE + orchestrator)
if: >-
github.event_name == 'workflow_dispatch' ||
(
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.comment.user.login == 'claude[bot]' &&
contains(github.event.comment.body, '## Code Review') &&
!contains(github.event.comment.body, '<!-- review-feedback-analysis -->') &&
!contains(github.event.comment.body, '<!-- review-verdict: clean -->') &&
!contains(github.event.comment.body, '<!-- review-verdict: issues-found -->')
)
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Determine PR number
id: pr
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "number=${{ inputs.pr_number }}" >> "$GITHUB_OUTPUT"
else
echo "number=${{ github.event.issue.number }}" >> "$GITHUB_OUTPUT"
fi
- name: Fetch review comment
env:
GH_TOKEN: ${{ github.token }}
EVENT_NAME: ${{ github.event_name }}
COMMENT_BODY: ${{ github.event.comment.body }}
PR_NUMBER: ${{ steps.pr.outputs.number }}
REPO: ${{ github.repository }}
run: |
if [ "$EVENT_NAME" = "workflow_dispatch" ]; then
gh api "repos/$REPO/issues/$PR_NUMBER/comments" \
--jq '[.[] | select(.user.login == "claude[bot]" and (.body | contains("## Code Review")))] | last | .body' \
> /tmp/review-comment.txt
else
printf '%s' "$COMMENT_BODY" > /tmp/review-comment.txt
fi
# 383-5: This is now a canary path. With 383-4 (verdict trailer validation in
# claude.yml), trailers should always be present. If this job fires, it means
# the validation step also failed — investigate both.
- name: Warn on missing verdict trailer (canary)
if: github.event_name == 'issue_comment'
env:
GH_TOKEN: ${{ github.token }}
PR_NUMBER: ${{ steps.pr.outputs.number }}
REPO: ${{ github.repository }}
run: |
echo "::error::Legacy bypass canary triggered — verdict trailer missing despite claude.yml validation (383-4). Investigate."
gh pr comment "$PR_NUMBER" --repo "$REPO" \
--body "<!-- pipeline-bypass-warning -->
> **⚠️ Pipeline bypass (canary):** Review from claude[bot] contains \`## Code Review\` but no verdict trailer (\`<!-- review-verdict: ... -->\`). This should not happen — the trailer validation in \`claude.yml\` should have caught this. Falling back to legacy triage. Investigate the review step output."
- name: Analyze review feedback
env:
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
PR_NUMBER: ${{ steps.pr.outputs.number }}
REPO: ${{ github.repository }}
run: node .github/scripts/analyze-review-feedback.mjs
- name: Post analysis comment
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr comment "${{ steps.pr.outputs.number }}" \
--body-file /tmp/analysis-output.md
clean-gate:
# Fast-path: clean review verdict — skip analysis, post ready-to-merge
if: >-
github.event_name == 'issue_comment' &&
github.event.issue.pull_request &&
github.event.comment.user.login == 'claude[bot]' &&
contains(github.event.comment.body, '<!-- review-verdict: clean -->') &&
!contains(github.event.comment.body, '<!-- review-feedback-analysis -->')
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Post ready-to-merge comment
env:
GH_TOKEN: ${{ github.token }}
run: |
gh pr comment "${{ github.event.issue.number }}" \
--repo "${{ github.repository }}" \
--body "<!-- review-feedback-analysis -->
## ✅ Ready to Merge
Code review found no significant issues. This PR is ready for human approval and merge."