-
Notifications
You must be signed in to change notification settings - Fork 0
fix(claude-code-review): finalize stuck check + add check_neutral summary-mode #105
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
c20ec95
f643d5a
092a074
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -28,6 +28,9 @@ on: | |
| description: > | ||
| How the review output should be posted: | ||
| - check: post as a check run (requires checks: write permission) | ||
| - check_neutral: like check, but uses GitHub's non-blocking `neutral` | ||
| conclusion when issues are found, so the check does not shadow | ||
| real CI checks in the PR status rollup | ||
| - comment: post as a PR comment | ||
| - auto: check if allowed, otherwise post as a comment | ||
| default: auto | ||
|
|
@@ -171,3 +174,30 @@ jobs: | |
| ANTHROPIC_VERTEX_PROJECT_ID: ${{ secrets.ANTHROPIC_VERTEX_PROJECT_ID }} | ||
| CLOUD_ML_REGION: ${{ secrets.CLOUD_ML_REGION }} | ||
| PUBLISH_MODE: ${{ inputs.summary-mode }} | ||
|
|
||
| # Finalize the "Claude Code Review" check when the review job did not | ||
| # complete normally (action failure, runner timeout, cancellation). | ||
| # Without this the check sits at status=in_progress forever and blocks | ||
| # any branch protection that waits on it. PATCHes via gh api directly | ||
| # so the step has no coupling to the skill's helper script and is a | ||
| # natural no-op when no in-progress check exists (e.g. legacy skill). | ||
| - name: Finalize stuck Claude Code Review check | ||
| if: always() && steps.claude-review.outcome != 'success' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should not be called when using legacy skill (from the repo) which does not rely on the script...
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Added steps.claude-review.outcome != 'success' so it only applies when required |
||
| env: | ||
| OWNER_REPO: ${{ github.repository }} | ||
| HEAD_SHA: ${{ github.event.pull_request.head.sha }} | ||
| RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} | ||
| run: | | ||
| check_id=$(gh api "repos/${OWNER_REPO}/commits/${HEAD_SHA}/check-runs" \ | ||
| -f check_name="Claude Code Review" \ | ||
| --jq '.check_runs[] | select(.status != "completed") | .id' | head -1) | ||
| if [[ -z "${check_id}" ]]; then | ||
| echo "No in-progress 'Claude Code Review' check on this SHA — nothing to finalize" | ||
| exit 0 | ||
| fi | ||
| summary="Claude review job did not complete (action failure, timeout, or cancellation). See [workflow logs](${RUN_URL})." | ||
| jq -n --arg summary "${summary}" '{ | ||
| status: "completed", | ||
| conclusion: "cancelled", | ||
| output: { title: "Claude Code Review: cancelled", summary: $summary } | ||
| }' | gh api "repos/${OWNER_REPO}/check-runs/${check_id}" --method PATCH --input - | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI (and probably not the point of this PR) : ideally, I would have called the script from here, instead of letting claude do it. This however required finding how to generate an "outcome" from Claude, and process it in next step, which I did not have to investigate....
(start of review could be posted here instead of in the skill)