File tree Expand file tree Collapse file tree 1 file changed +20
-3
lines changed
Expand file tree Collapse file tree 1 file changed +20
-3
lines changed Original file line number Diff line number Diff line change @@ -1128,6 +1128,24 @@ def is_fas_verification_comment(self, comment: str) -> bool:
11281128
11291129 return bool (command and command [0 ] == PACKIT_VERIFY_FAS_COMMAND )
11301130
1131+ def retieve_comment_command_prefix (self , comment : str ) -> Optional [str ]:
1132+ """
1133+ Retrieves the Packit prefix used in comment.
1134+
1135+ Args:
1136+ comment: Comment to retrieve prefix from.
1137+
1138+ Returns:
1139+ Packit comment command prefix or None if none is found.
1140+ """
1141+ prefixes = ["/packit-ci-stg" , "/packit-ci" , "/packit-stg" , "/packit" ]
1142+
1143+ for prefix in prefixes :
1144+ if comment .startswith (prefix ):
1145+ return prefix
1146+
1147+ return None
1148+
11311149 def is_help_comment (self , comment : str ) -> bool :
11321150 """
11331151 Checks whether the comment contains Packit help command:
@@ -1139,9 +1157,8 @@ def is_help_comment(self, comment: str) -> bool:
11391157 Returns:
11401158 `True`, if is help comment, `False` otherwise.
11411159 """
1142- packit_comment_command_prefix = (
1143- "/packit-ci" if comment .startswith ("/packit-ci" ) else "/packit"
1144- )
1160+ if not (packit_comment_command_prefix := self .retieve_comment_command_prefix (comment )):
1161+ return False
11451162
11461163 command = get_packit_commands_from_comment (
11471164 comment ,
You can’t perform that action at this time.
0 commit comments