diff --git a/.github/workflows/claude-pr-review.yml b/.github/workflows/claude-pr-review.yml index c75ccb5..f230400 100644 --- a/.github/workflows/claude-pr-review.yml +++ b/.github/workflows/claude-pr-review.yml @@ -9,6 +9,7 @@ jobs: # TODO: remove author filter after testing is complete if: github.event.pull_request.draft == false && github.event.pull_request.user.login == 'zfarrell' runs-on: ubuntu-latest + timeout-minutes: 15 permissions: contents: read pull-requests: write @@ -29,6 +30,7 @@ jobs: - uses: actions/checkout@v4 with: repository: hotdata-dev/github-workflows + ref: main token: ${{ steps.app-token.outputs.token }} path: .github-workflows sparse-checkout: docs/claude-pr-review-prompt.md @@ -43,6 +45,8 @@ jobs: echo "EOF" >> $GITHUB_OUTPUT - uses: anthropics/claude-code-action@v1 + id: review + continue-on-error: true with: anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }} track_progress: false @@ -53,3 +57,9 @@ jobs: ${{ steps.prompt.outputs.content }} claude_args: | --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr review:*),Read" + + - name: Notify on review failure + if: steps.review.outcome == 'failure' || steps.review.outcome == 'cancelled' + run: gh pr comment ${{ github.event.pull_request.number }} --body "Automated review unavailable (Claude step failed). Please review manually." + env: + GH_TOKEN: ${{ github.token }}