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:
- Set up the GitHub Action workflow with
issue_comment: [created] trigger, following the docs examples.
- Comment
/review on a PR.
- pr-agent posts "Preparing review..." as a comment.
- That comment triggers another
issue_comment event.
- 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.
When using pr-agent as a GitHub Action with the
issue_commenttrigger, the action re-fires on comments it posts itself (e.g. "Preparing review..."). Each of those comments triggers another workflow run, which then fails withUnknown command: preparingbecause the comment body gets parsed as a command.Steps to reproduce:
issue_comment: [created]trigger, following the docs examples./reviewon a PR.issue_commentevent.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-actionsactor) rather than requiring users to discover and add this guard. Two options:sender.typeand skip processing when the sender is a Bot, so users do not need theifguard at all.ifcondition 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.