Skip to content
Merged
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
27 changes: 0 additions & 27 deletions .claude/schemas/code-review-output.json

This file was deleted.

15 changes: 0 additions & 15 deletions .claude/scripts/addPrReaction.sh

This file was deleted.

66 changes: 0 additions & 66 deletions .claude/scripts/createInlineComment.sh

This file was deleted.

31 changes: 0 additions & 31 deletions .github/scripts/extractAllowedRules.sh

This file was deleted.

32 changes: 17 additions & 15 deletions .github/workflows/claude-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,19 +49,15 @@ jobs:
- 'docs/**/*.md'
- 'docs/**/*.csv'

- name: Add claude utility scripts to PATH
run: |
echo "$GITHUB_WORKSPACE/.claude/scripts" >> "$GITHUB_PATH"
- name: Setup Claude review toolkit
id: toolkit
uses: Expensify/GitHub-Actions/.github/actions/claude-review-toolkit@43c1b4348cd46637e44064b02f5d316bfab990ee
Comment thread
kacper-mikolajczak marked this conversation as resolved.

- name: Extract allowed rules from coding standards
- name: Mark review as in progress
env:
GH_TOKEN: ${{ github.token }}
run: |
"$GITHUB_WORKSPACE/.github/scripts/extractAllowedRules.sh" \
"$GITHUB_WORKSPACE/.claude/skills/coding-standards/rules" \
"$RUNNER_TEMP/allowed-rules.txt"

- name: Load code review JSON schema
id: schema
run: echo "json=$(jq -c . "$GITHUB_WORKSPACE/.claude/schemas/code-review-output.json")" >> "$GITHUB_OUTPUT"
addPrReaction.sh "$PR_NUMBER" "eyes"

- name: Run Claude Code (code)
id: code-review
Expand All @@ -75,28 +71,27 @@ jobs:
prompt: "/review-code-pr REPO: ${{ github.repository }} PR_NUMBER: ${{ github.event.pull_request.number }}"
claude_args: |
--model claude-opus-4-6
--allowedTools "Task,Glob,Grep,Read,Bash(gh pr diff:*),Bash(gh pr view:*),Bash(check-compiler.sh:*)" --json-schema '${{ steps.schema.outputs.json }}'
--allowedTools "Task,Glob,Grep,Read,Bash(gh pr diff:*),Bash(gh pr view:*),Bash(check-compiler.sh:*)" --json-schema '${{ steps.toolkit.outputs.schema_json }}'

- name: Post code review results
if: steps.code-review.outcome == 'success' && steps.filter.outputs.code == 'true'
env:
GH_TOKEN: ${{ github.token }}
STRUCTURED_OUTPUT: ${{ steps.code-review.outputs.structured_output }}
ALLOWED_RULES_FILE: ${{ runner.temp }}/allowed-rules.txt
run: |
if [ -z "$STRUCTURED_OUTPUT" ]; then
echo "::error::Claude Code Action returned empty structured output"
exit 1
fi
COUNT=$(echo "$STRUCTURED_OUTPUT" | jq '.violations | length')
if [ "$COUNT" -eq 0 ]; then
addPrReaction.sh "$PR_NUMBER"
addPrReaction.sh "$PR_NUMBER" "+1"
else
echo "$STRUCTURED_OUTPUT" | jq -c '.violations[]' | while IFS= read -r v; do
PATH_ARG=$(echo "$v" | jq -r '.path')
BODY_ARG=$(echo "$v" | jq -r '.body')
LINE_ARG=$(echo "$v" | jq -r '.line')
createInlineComment.sh "$PATH_ARG" "$BODY_ARG" "$LINE_ARG" || true
createInlineComment.sh "$PR_NUMBER" "$PATH_ARG" "$BODY_ARG" "$LINE_ARG" || true
done
fi

Expand All @@ -112,3 +107,10 @@ jobs:
claude_args: |
--model claude-opus-4-6
--allowedTools "Task,Glob,Grep,Read,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),mcp__github_inline_comment__create_inline_comment"

- name: Remove in-progress indicator
if: always()
env:
GH_TOKEN: ${{ github.token }}
run: |
removePrReaction.sh "$PR_NUMBER" "eyes" "github-actions[bot]"
Loading