Skip to content

GitHub Action re-triggers on its own bot comments, causing feedback loop #2398

@ShivamB25

Description

@ShivamB25

When using pr-agent as a GitHub Action with the issue_comment trigger, the action re-fires on comments it posts itself (e.g. "Preparing review..."). Each of those comments triggers another workflow run, which then fails with Unknown command: preparing because the comment body gets parsed as a command.

Steps to reproduce:

  1. Set up the GitHub Action workflow with issue_comment: [created] trigger, following the docs examples.
  2. Comment /review on a PR.
  3. pr-agent posts "Preparing review..." as a comment.
  4. That comment triggers another issue_comment event.
  5. The runner parses "Preparing review..." and logs Unknown command: preparing, then exits.

The workaround is adding if: \${{ github.event.sender.type != Bot }}` to the job, which the docs mention in some examples but not all — and it is not included in the generated workflow snippet from the "quick start" section.

It would be better if the action handler itself ignored comments from bots (or at least from its own github-actions actor) rather than requiring users to discover and add this guard. Two options:

  • Have the action entrypoint check sender.type and skip processing when the sender is a Bot, so users do not need the if guard at all.
  • Or at minimum, make the if condition prominent in every example and the quick-start snippet, since missing it causes a visible feedback loop on every PR where someone uses a slash command.

Running pr-agent@main via GitHub Actions, container image pragent/pr-agent:latest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions