fix: allow multiline commands
This commit is contained in:
@@ -4,7 +4,7 @@ import re
|
||||
|
||||
from agentci.domain.models import CommandName, JobKind, ParsedCommand
|
||||
|
||||
COMMAND_RE = re.compile(r"^/agent[ \t]+([a-z]+)(?:[ \t]+([\s\S]*))?$")
|
||||
COMMAND_RE = re.compile(r"^/agent[ \t]+([a-z]+)(?:[ \t\r\n]+([\s\S]*))?$")
|
||||
|
||||
|
||||
class CommandError(ValueError):
|
||||
@@ -46,4 +46,3 @@ def resolve_job_kind(command: ParsedCommand, *, is_pull_request: bool) -> JobKin
|
||||
if command.name not in mapping:
|
||||
raise CommandError(f"`/agent {command.name}` can only be used on a pull request.")
|
||||
return mapping[command.name]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user