ignore bot pr option on github app mode

This commit is contained in:
koid
2024-03-18 15:30:16 +09:00
parent dd83b196b4
commit 80a793a257
2 changed files with 7 additions and 0 deletions

View File

@ -121,6 +121,12 @@ async def handle_new_pr_opened(body: Dict[str, Any],
action: str,
log_context: Dict[str, Any],
agent: PRAgent):
# logic to ignore PRs opened by bot
if get_settings().get("GITHUB_APP.IGNORE_BOT_PR", False):
if re.match('.+\[bot]$', sender) is not None:
get_logger().info(f"Ignoring PR by sender '{sender}' due to github_app.ignore_bot_pr setting")
return {}
title = body.get("pull_request", {}).get("title", "")
# logic to ignore PRs with specific titles (e.g. "[Auto] ...")