Skip to content

Commit 94384bd

Browse files
Update entrypoint.sh
1 parent 895941f commit 94384bd

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

entrypoint.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@ echo $INPUT_OPTIONS
88

99
SUPPORTED_COMMANDS=("/review" "review")
1010

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
1216
for command in "${SUPPORTED_COMMANDS[@]}"; do
13-
if [ "$command" = "$INPUT_COMMAND" ]; then
17+
if [[ "$INPUT_COMMAND" =~ ^$command ]]; then
1418
valid_command=true
1519
break
1620
fi
@@ -20,7 +24,7 @@ done
2024
# Run the Docker container from the specified image
2125
if [ "$valid_command" = true ]; then
2226
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
2428
else
2529
echo "$INPUT_COMMAND is not supported"
2630
exit 0 # Exit the script with a non-zero status code

0 commit comments

Comments
 (0)