anthropics / anthropics/claude-code-action

Notifications Change

Open
#1,122 0 comments 0 reactions 0 assignees View on GitHub
bug p2
Dominant language
TypeScript
Stars
8.9k
Forks
2.1k
Avg merge
3d 9h
Merged PRs (30d)
10

Description

**Describe the bug**
After the latest update, our attempt to have claude only post one notification email instead of one per comment broke

**To Reproduce**

It used to just produce one email with all comments, same as if you manually did a "start a review" in github and added a bunch of comments. After the last update we are getting 1 email per comment.

**Expected behavior**
I expect claude to produce one email with all comments in it instead of an email per comment

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Workflow yml file**
name: 'Claude Code Review'
description: 'Run Claude Code for PR reviews and @claude mentions'

inputs:
anthropic_api_key:
description: 'Anthropic API key'
required: true
prompt:
description: 'Custom prompt for Claude (optional, fully overrides the default PR review prompt)'
required: false
default: ''
additional_prompt:
description: 'Additional review instructions inserted into the default PR review prompt (ignored if prompt is set)'
required: false
default: ''
claude_args:
description: 'Additional Claude CLI arguments'
required: false
default: '--allowedTools "Bash(gh api:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),mcp__github_inline_comment__create_inline_comment"'
show_full_output:
description: 'Show full Claude output in workflow logs'
required: false
default: 'false'

runs:
using: composite
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- id: resolve-prompt
shell: bash
env:
CUSTOM_PROMPT: ${{ inputs.prompt }}
ADDITIONAL_PROMPT: ${{ inputs.additional_prompt }}
REPO: ${{ github.repository }}
PR_NUMBER: ${{ github.event.pull_request.number }}
EVENT_NAME: ${{ github.event_name }}
run: |
if [ -n "$CUSTOM_PROMPT" ]; then
{
echo "prompt<> "$GITHUB_OUTPUT"
elif [ "$EVENT_NAME" = "pull_request" ]; then
{
echo "prompt<",'
echo ' "event": "COMMENT",'
echo ' "comments": ['
echo ' { "path": "", "line": , "side": "RIGHT", "body": "" },'
echo ' { "path": "", "line": , "side": "RIGHT", "body": "" }'
echo ' ]'
echo "}"
echo "EOF"
echo ""
echo 'For inline comments: use "line" for the actual file line number (not diff position),'
echo '"side": "RIGHT" for added/unchanged lines, "side": "LEFT" for removed lines.'
echo ""
echo "Collect ALL feedback before submitting. Only call the API once - never post individual comments."
echo "PROMPT_DELIM"
} >> "$GITHUB_OUTPUT"
fi

- uses: anthropics/claude-code-action@v1
with:
anthropic_api_key: ${{ inputs.anthropic_api_key }}
prompt: ${{ steps.resolve-prompt.outputs.prompt }}
claude_args: ${{ inputs.claude_args }}
show_full_output: ${{ inputs.show_full_output }}

**API Provider**

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

**Additional context**
Add any other context about the problem here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.