anthropics / anthropics/claude-code-action

Claude Code exits with code 5 after successful PR review

Aperta
#846 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
bug dev-experience p2 provider:bedrock
Lingua principale
TypeScript
Stelle
8.9k
Fork
2.1k
Merge medio
3g 9h
PR unite (30g)
10

Descrizione

**Describe the bug**

Claude Code Action successfully completes a PR review (posts comments to the PR) but then exits with code 5, causing the GitHub Actions workflow to fail. The review is fully functional - comments are posted - but the non-zero exit code breaks CI pipelines.

**To Reproduce**

1. Set up a workflow using `anthropics/claude-code-action@v1` with AWS Bedrock
2. Trigger a PR review via `@claude` mention
3. Claude successfully analyzes the PR and posts review comments
4. Action exits with code 5 despite successful execution

**Expected behavior**

When Claude successfully completes a review and posts comments, the action should exit with code 0.

**Screenshots**

GitHub Actions log showing the error:
```
2026-01-20T15:33:16.4373874Z Successfully formatted Claude Code report
...
2026-01-20T15:33:16.7597431Z ##[error]Process completed with exit code 5.
```

The review was successfully posted (multiple inline comments about SQL injection and N+1 queries were added to the PR).

**Workflow yml file**

```yaml
name: Claude PR Review

on:
issue_comment:
types: [created]

jobs:
claude-review:
if: github.event.issue.pull_request && contains(github.event.comment.body, '@claude')
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
issues: write
steps:
- uses: actions/checkout@v4

- uses: anthropics/claude-code-action@v1
with:
use_bedrock: 'true'
prompt: |
Review this PR for code quality issues.
claude_args: |
--model eu.anthropic.claude-sonnet-4-5-20250929-v1:0
--allowedTools "mcp__github__get_pull_request,mcp__github__get_pull_request_diff,mcp__github__get_pull_request_files,mcp__github__get_pull_request_status,mcp__github__pull_request_read,mcp__github__create_pending_pull_request_review,mcp__github__submit_pending_pull_request_review,mcp__github__pull_request_review_write,mcp__github__add_comment_to_pending_review,mcp__github__add_issue_comment,Bash(gh pr view:*),Bash(gh pr diff:*),Bash(gh api:*),Grep,Read"
```

**API Provider**

- [ ] Anthropic First-Party API (default)
- [x] AWS Bedrock
- [ ] GCP Vertex

**Additional context**
- **Model used**: `eu.anthropic.claude-sonnet-4-5-20250929-v1:0`
- **Bun version**: 1.2.11

The action clearly succeeded in its task (review comments were posted), but something in the cleanup or finalization phase returns exit code 5. This makes it impossible to use the action in CI pipelines without `continue-on-error: true`, which defeats the purpose of detecting actual failures.

Exit code 5 doesn't appear to be documented. Is this a known exit code? What does it signify?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.