File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -8,9 +8,13 @@ echo $INPUT_OPTIONS
8
8
9
9
SUPPORTED_COMMANDS=(" /review" " review" )
10
10
11
- INPUT_COMMAND=$( echo " $INPUT_COMMAND " | tr -d ' [:space:]' )
11
+ # INPUT_COMMAND=$(echo "$INPUT_COMMAND" | tr -d '[:space:]')
12
+ INPUT_COMMAND=$( echo " $INPUT_COMMAND " | xargs)
13
+
14
+
15
+ # Check if the command starts with any of the supported commands
12
16
for command in " ${SUPPORTED_COMMANDS[@]} " ; do
13
- if [ " $command " = " $INPUT_COMMAND " ]; then
17
+ if [[ " $INPUT_COMMAND " =~ ^ $command ] ]; then
14
18
valid_command=true
15
19
break
16
20
fi
20
24
# Run the Docker container from the specified image
21
25
if [ " $valid_command " = true ]; then
22
26
docker pull bitoai/cra:latest >&2
23
- exec docker run bitoai/cra:latest --mode=cli --pr_url $INPUT_PR $INPUT_COMMAND $INPUT_OPTIONS
27
+ exec docker run bitoai/cra:latest --mode=cli --pr_url $INPUT_PR --command $INPUT_COMMAND $INPUT_OPTIONS
24
28
else
25
29
echo " $INPUT_COMMAND is not supported"
26
30
exit 0 # Exit the script with a non-zero status code
You can’t perform that action at this time.
0 commit comments