From 048d90623fdd5d73ded55319be7434937644f941 Mon Sep 17 00:00:00 2001 From: Ori Kotek Date: Wed, 21 Feb 2024 17:59:58 +0200 Subject: [PATCH] Ignore comment not starting with a slash --- pr_agent/servers/github_app.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pr_agent/servers/github_app.py b/pr_agent/servers/github_app.py index a218f191..f4c0a067 100644 --- a/pr_agent/servers/github_app.py +++ b/pr_agent/servers/github_app.py @@ -92,6 +92,9 @@ async def handle_request(body: Dict[str, Any], event: str): if "comment" not in body: return {} comment_body = body.get("comment", {}).get("body") + if not comment_body.lsstrip().startswith("/"): + get_logger().info("Ignoring comment not starting with /") + return {} if sender and bot_user in sender: get_logger().info(f"Ignoring comment from {bot_user} user") return {}