Add ignore_repositories config for PR filtering

What Changed?
* Added support to ignore PRs/MRs from specific repositories in GitHub, Bitbucket, and GitLab webhook logic
* Updated configuration.toml to include ignore_repositories option
* Added unit tests for ignore_repositories across all supported providers
This commit is contained in:
Mike Davies
2025-04-30 14:09:40 -07:00
parent 7b82b08173
commit d606672801
5 changed files with 112 additions and 0 deletions

View File

@ -258,6 +258,14 @@ def should_process_pr_logic(body) -> bool:
source_branch = pull_request.get("head", {}).get("ref", "")
target_branch = pull_request.get("base", {}).get("ref", "")
sender = body.get("sender", {}).get("login")
repo_full_name = body.get("repository", {}).get("full_name", "")
# logic to ignore PRs from specific repositories
ignore_repos = get_settings().get("CONFIG.IGNORE_REPOSITORIES", [])
if ignore_repos and repo_full_name:
if repo_full_name in ignore_repos:
get_logger().info(f"Ignoring PR from repository '{repo_full_name}' due to 'config.ignore_repositories' setting")
return False
# logic to ignore PRs from specific users
ignore_pr_users = get_settings().get("CONFIG.IGNORE_PR_AUTHORS", [])