diff --git a/.github/workflows/claude-review.yml b/.github/workflows/claude-review.yml index ff4ff643644e..f8c041e6cffb 100644 --- a/.github/workflows/claude-review.yml +++ b/.github/workflows/claude-review.yml @@ -41,7 +41,7 @@ jobs: USERNAME: ${{ github.event.review.user.login }} OS_BOTIFY_TOKEN: ${{ secrets.OS_BOTIFY_TOKEN }} - review: + review-code: needs: [validate, checkCPlusApproval] if: | !cancelled() @@ -70,15 +70,14 @@ jobs: filters: | code: - 'src/**' - docs: - - 'docs/**/*.md' - - 'docs/**/*.csv' - name: Setup Claude review toolkit + if: steps.filter.outputs.code == 'true' id: toolkit uses: Expensify/GitHub-Actions/.github/actions/claude-review-toolkit@43c1b4348cd46637e44064b02f5d316bfab990ee - name: Mark review as in progress + if: steps.filter.outputs.code == 'true' env: GH_TOKEN: ${{ github.token }} run: | @@ -99,7 +98,7 @@ jobs: --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' + if: steps.code-review.outcome == 'success' env: GH_TOKEN: ${{ github.token }} STRUCTURED_OUTPUT: ${{ steps.code-review.outputs.structured_output }} @@ -120,6 +119,52 @@ jobs: done fi + - name: Remove in-progress indicator + if: always() && steps.filter.outputs.code == 'true' + env: + GH_TOKEN: ${{ github.token }} + run: | + removePrReaction.sh "$PR_NUMBER" "eyes" "github-actions[bot]" + + review-docs: + needs: [validate, checkCPlusApproval] + if: | + !cancelled() + && github.event.pull_request.draft != true + && !contains(github.event.pull_request.title, 'Revert') + && ( + (github.event_name == 'pull_request_target' && needs.validate.outputs.IS_AUTHORIZED == 'true') + || (github.event_name == 'pull_request_review' && needs.checkCPlusApproval.outputs.IS_CPLUS == 'true') + ) + runs-on: blacksmith-2vcpu-ubuntu-2404 + env: + PR_NUMBER: ${{ github.event.pull_request.number }} + steps: + - name: Checkout repository + uses: useblacksmith/checkout@c9796daa2a4bdebdab5bd16be2c09a70cd4e1121 # v1 + with: + fetch-depth: 1 + + - name: Filter paths + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 + id: filter + with: + filters: | + docs: + - 'docs/**/*.md' + - 'docs/**/*.csv' + + - name: Setup Claude review toolkit + if: steps.filter.outputs.docs == 'true' + uses: Expensify/GitHub-Actions/.github/actions/claude-review-toolkit@43c1b4348cd46637e44064b02f5d316bfab990ee + + - name: Mark review as in progress + if: steps.filter.outputs.docs == 'true' + env: + GH_TOKEN: ${{ github.token }} + run: | + addPrReaction.sh "$PR_NUMBER" "eyes" + - name: Run Claude Code (docs) if: steps.filter.outputs.docs == 'true' uses: anthropics/claude-code-action@ba026a3e56b9f646ae3b1be02dd9c0812aa2f8ae # v1.0.86 @@ -134,7 +179,7 @@ jobs: --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() + if: always() && steps.filter.outputs.docs == 'true' env: GH_TOKEN: ${{ github.token }} run: |