Skip to content

Avoid duplicate comments on PR synchronize events #5

@Sultanyaron

Description

@Sultanyaron

Description

When the review-pr action runs with the synchronize event, the augment agent posts multiple comments.

For example, if a PR has multiple commits pushed in sequence, the action may leave duplicate comments for essentially the same review message. This clutters the PR discussion and makes it harder to follow.


## .github/workflows/pr-review.yml

name: Auto-review PRs
on:
  pull_request:
    types: [opened, synchronize]
    branches: [main]

jobs:
  review:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
    steps:
      - name: Generate PR Review
        uses: augmentcode/review-pr@v0
        with:
          augment_session_auth: ${{ secrets.AUGMENT_SESSION_AUTH }}
          github_token: ${{ secrets.GITHUB_TOKEN }}
          pull_number: ${{ github.event.pull_request.number }}
          repo_name: ${{ github.repository }}

Steps to Reproduce

  1. Open a PR.
  2. Push multiple commits to the branch.
  3. Observe that the review action posts multiple comments repeating the same content.

Expected Behavior

The action should avoid posting duplicate comments on synchronize events.


Proposed Solution

One possible solution is to follow the approach used by cursor bug-bot, which marks previous comments as outdated when a new one is posted.

Image

This way, the PR conversation stays clean, and reviewers always see only the most relevant feedback.


Benefits

  • 🧹 Prevents clutter in the PR discussion.
  • 🎯 Keeps review feedback focused and easy to follow.
  • 🔁 Aligns with established patterns in other review bots.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions