Skip to content

Commit ab331f1

Browse files
chmouelpipelines-as-code[bot]
authored andcommitted
make sure the user cannot merge itself without approval
Signed-off-by: Chmouel Boudjnah <chmouel@redhat.com>
1 parent 7c5a4ef commit ab331f1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

boussole/boussole.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,10 @@ def merge_pr(self, custom_merge_method: Optional[str] = None) -> bool:
438438
# Fetch LGTM votes
439439
valid_votes, lgtm_users = self._fetch_and_validate_lgtm_votes()
440440
# Handle case where admin/write user can merge directly
441-
if permission in ["admin", "write"]:
441+
if self.pr_sender not in self.comment_sender and permission in [
442+
"admin",
443+
"write",
444+
]:
442445
# If threshold is 1, the user with admin/write can merge directly
443446
# For threshold > 1, count their merge command as a vote if not already counted
444447
merger_already_voted = self.comment_sender in lgtm_users

0 commit comments

Comments
 (0)