@@ -36,14 +36,11 @@ def __init__(self, params: Dict[str, Any] | None = None):
3636
3737 def notify (self , facts : Dict [str , Any ]) -> None :
3838 notifications = facts .get ('notifications' , []) or []
39+ labels_enabled = self .config .get ('pr_labels_enabled' , True )
3940
4041 if not isinstance (notifications , list ):
4142 logger .error ('GithubPRNotifier: only supports new format - list of dicts with title/content' )
4243 return
43-
44- if not notifications :
45- logger .info ('GithubPRNotifier: no notifications present; skipping' )
46- return
4744
4845 # Get full scan URL if available and store it for use in truncation
4946 self .full_scan_url = facts .get ('full_scan_html_url' )
@@ -58,6 +55,13 @@ def notify(self, facts: Dict[str, Any]) -> None:
5855 logger .warning ('GithubPRNotifier: skipping invalid notification item: %s' , type (item ))
5956
6057 if not valid_notifications :
58+ if labels_enabled :
59+ pr_number = self ._get_pr_number ()
60+ if pr_number :
61+ self ._reconcile_pr_labels (pr_number , [])
62+ else :
63+ logger .warning ('GithubPRNotifier: unable to determine PR number for label reconciliation' )
64+ logger .info ('GithubPRNotifier: no notifications present; skipping comments' )
6165 return
6266
6367 # Get PR number for current branch
@@ -117,7 +121,7 @@ def notify(self, facts: Dict[str, Any]) -> None:
117121 logger .error ('GithubPRNotifier: failed to post individual comment' )
118122
119123 # Add labels to PR if enabled
120- if self . config . get ( 'pr_labels_enabled' , True ) and pr_number :
124+ if labels_enabled and pr_number :
121125 labels = self ._determine_pr_labels (valid_notifications )
122126 self ._reconcile_pr_labels (pr_number , labels )
123127 def _managed_pr_label_config (self ) -> Dict [str , str ]:
0 commit comments