File tree Expand file tree Collapse file tree 1 file changed +7
-6
lines changed
.github/workflows/scripts Expand file tree Collapse file tree 1 file changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -301,9 +301,13 @@ def issue_comment_label_actions(
301301 LOGGER .info (f"Processing labels: { labels } " )
302302 for label , action in labels .items ():
303303 if label == LGTM_LABEL_STR :
304- label = f"{ LGTM_BY_LABEL_PREFIX } { self .user_login } "
305- if not action [CANCEL_ACTION ] or self .event_action == "deleted" :
306- self .approve_pr ()
304+ if self .user_login == self .pr .user .login :
305+ LOGGER .info ("PR submitter cannot approve for their own PR" )
306+ continue
307+ else :
308+ label = f"{ LGTM_BY_LABEL_PREFIX } { self .user_login } "
309+ if not action [CANCEL_ACTION ] or self .event_action == "deleted" :
310+ self .approve_pr ()
307311
308312 label_in_pr = any ([label == _label .lower () for _label in self .pr_labels ])
309313 LOGGER .info (f"Processing label: { label } , action: { action } " )
@@ -327,9 +331,6 @@ def add_welcome_comment(self) -> None:
327331 self .pr .create_issue_comment (body = WELCOME_COMMENT )
328332
329333 def approve_pr (self ) -> None :
330- if self .user_login == self .pr .user .login :
331- LOGGER .info ("PR submitter cannot trigger approval for their own PR" )
332- return
333334 self .pr .create_review (event = "APPROVE" )
334335
335336 def dismiss_pr_approval (self ) -> None :
You can’t perform that action at this time.
0 commit comments