Skip to content

v1.0.5 runs but can't pick up the PR context nor post the output as a comment on the PR itself. #557

@polis80cy

Description

@polis80cy

Describe the bug
GH Claude v1.0.5 actions runs as a result of tagging @claude in a comment with an ask to review the PR. However, it the action doesn't seem able to pick up the PR context, and won't post anything on the PR itself as a comment.

What am I missing?

To Reproduce
Steps to reproduce the behavior:

  1. Go to open PR
  2. Tag @claude in a comment with an ask to review PR
  3. GH Claude action runs
  4. No output / comment gets posted on PR

Expected behavior
GH Claude action runs successfully, picks up the PR context, posts the output as a comment on the PR itself.

Screenshots

Triggering Claude:
Image

Claude action summary:
Image
Image
Image
Image

Workflow yml file

name: Claude Code Review

on:
  issue_comment:
    types: [created]
  pull_request_review_comment:
    types: [created]
  pull_request_review:
    types: [submitted]

jobs:
  claude-review:
    if: |
      (github.event_name == 'issue_comment' && github.event.issue.pull_request && contains(github.event.comment.body, '@claude')) ||
      (github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
      (github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude'))
    
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
      issues: write
      id-token: write
    
    steps:
      - name: Checkout repository
        uses: actions/checkout@v4
        with:
          fetch-depth: 1

      - name: Run Claude Code Review
        uses: anthropics/claude-code-action@v1.0.5
        with:
          anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}

          # Minimal, actionable review prompt - no positive feedback
          prompt: |
            Review this PR and provide ONLY specific, actionable feedback. Do not provide:
            - Positive feedback, praise, or "LGTM" comments
            - General suggestions or best practices
            - Formatting or style nitpicks
            - Explanations of what the code does
            
            ONLY comment if you find:
            - Security vulnerabilities with exact fix
            - Bugs with specific line numbers and solutions
            - Breaking changes that need addressing
            - Missing error handling with exact implementation
            - Performance issues with specific optimization
            - Code quality issues like violations of established patterns, maintainability concerns, and significant readability issues
            
            Format: "[file:line]" for line-specific issues, "[file]" for file-level issues. Always include exact fix.
            
            If nothing actionable found, return "Nothing actionable found 👍"
          # Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
          use_sticky_comment: true
          
          # Tools for comprehensive PR review
          claude_args: |
           --append-system-prompt "Please refer to the project's CLAUDE.md file and .claude/agents/ documentation for:
            - Architecture patterns and conventions to follow
            - Testing patterns and requirements  
            - Code style guidelines and established practices
            - Technology stack and framework usage
            Pay special attention to violations of established patterns documented in these files."
            --allowedTools "mcp__github_inline_comment__create_inline_comment,Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*)"

API Provider

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

Metadata

Metadata

Assignees

Labels

area:permissionsbugSomething isn't workingmcpp1Showstopper bug preventing substantial subset of users from using the product, or incorrect docs

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions