Skip to content

[BUG] use_sticky_comment does not find existing comments when using github_token #960

@mmiermans

Description

@mmiermans

Describe the bug

use_sticky_comment: true does not find existing comments when github_token is provided. A new comment is created on every workflow run instead of updating the existing one.

The root cause is in src/github/operations/comments/create-initial.ts. The sticky search checks three criteria:

  1. comment.user?.id === CLAUDE_APP_BOT_ID (209825114, i.e. claude[bot])
  2. comment.user?.login.toLowerCase().includes("claude")
  3. comment.body === initialBody

When github_token is provided, comments are posted as github-actions[bot] (user ID 41898282). None of the three criteria match:

  • ID 41898282 !== 209825114
  • "github-actions" does not contain "claude"
  • The previous comment body has been updated with review content, so exact body match fails

To Reproduce

  1. Configure a workflow with use_sticky_comment: true and github_token: ${{ github.token }}
  2. Open a PR and let the review run
  3. Push another commit to the same PR
  4. A second comment is created instead of updating the first

Expected behavior

The action should find and update the existing comment from the previous run.

Workflow yml file

- uses: anthropics/claude-code-action@v1
  with:
    anthropic_api_key: ${{ secrets.ANTHROPIC_API_KEY }}
    github_token: ${{ github.token }}
    prompt: "/review"
    track_progress: true
    use_sticky_comment: true

API Provider

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

Additional context

Possibly related to #714 and #759, but those cover different aspects of the bot ID issue. A potential fix would be to also match on the github-actions[bot] user ID or use a hidden HTML marker in the comment body instead of relying on author matching.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingp2Non-showstopper bug or popular feature requestprovider:1pAnthropic First-Party API

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions