Skip to content

Notifications Change #1122

@BenKothParadigm

Description

@BenKothParadigm

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<<PROMPT_DELIM"
        echo "$CUSTOM_PROMPT"
        echo "PROMPT_DELIM"
      } >> "$GITHUB_OUTPUT"
    elif [ "$EVENT_NAME" = "pull_request" ]; then
      {
        echo "prompt<<PROMPT_DELIM"
        echo "REPO: $REPO"
        echo "PR NUMBER: $PR_NUMBER"
        echo ""
        if [ -n "$ADDITIONAL_PROMPT" ]; then
          echo "## YOUR TEAM'S REVIEW INSTRUCTIONS"
          echo ""
          echo "$ADDITIONAL_PROMPT"
          echo ""
        fi
        echo "Be concise and direct. Focus on bugs, security, and performance issues. Skip praise, pleasantries, and lengthy explanations."
        echo ""
        echo "The PR branch is already checked out in the current working directory."
        echo ""
        echo "Review the PR diff and collect ALL feedback first, then submit everything as a SINGLE review"
        echo "using the GitHub API so reviewers receive only one email notification."
        echo ""
        echo "To submit your review, pipe the JSON directly to gh api:"
        echo "gh api repos/\$REPO/pulls/\$PR_NUMBER/reviews \\"
        echo "  --method POST --input - << 'EOF'"
        echo "{"
        echo '  "body": "<overall summary>",'
        echo '  "event": "COMMENT",'
        echo '  "comments": ['
        echo '    { "path": "<file>", "line": <line>, "side": "RIGHT", "body": "<comment>" },'
        echo '    { "path": "<file>", "line": <line>, "side": "RIGHT", "body": "<comment>" }'
        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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2Non-showstopper bug or popular feature request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions