diff --git a/webhook_server_container/libs/github_api.py b/webhook_server_container/libs/github_api.py index bf173f01..4c57e9fe 100644 --- a/webhook_server_container/libs/github_api.py +++ b/webhook_server_container/libs/github_api.py @@ -1137,6 +1137,18 @@ def user_commands(self, command: str, reviewed_user: str, issue_comment_id: int) self._add_label(label=WIP_STR) self.pull_request.edit(title=f"{wip_for_title} {self.pull_request.title}") + elif _command == HOLD_LABEL_STR: + self.create_comment_reaction(issue_comment_id=issue_comment_id, reaction=REACTIONS.ok) + if reviewed_user not in self.approvers: + self.pull_request.create_issue_comment( + f"{reviewed_user} is not part of the approver, only approvers can mark pull request as hold" + ) + else: + if remove: + self._remove_label(label=HOLD_LABEL_STR) + else: + self._add_label(label=HOLD_LABEL_STR) + else: self.label_by_user_comment( user_requested_label=_command,