File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ FROM docker:20.10
2+
3+ RUN apk add bash
4+
5+ COPY entrypoint.sh /entrypoint.sh
6+ RUN chmod +x /entrypoint.sh
7+
8+
9+ ENTRYPOINT ["bash" , "/entrypoint.sh" ]
Original file line number Diff line number Diff line change 1+ # action.yml
2+ name : ' Docker Run Action'
3+ description : ' Run a command in a new container'
4+ inputs :
5+ options :
6+ description : ' additional parameters to run the Code Review Agent'
7+ required : true
8+ pr :
9+ description : ' PR URL which needs to be reviewed'
10+ required : true
11+ command :
12+ description : ' Use a specific command'
13+ required : true
14+ default : review
15+ runs :
16+ using : ' docker'
17+ image : ' Dockerfile'
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+
4+ # Arguments to run the Docker image
5+ echo $INPUT_PR
6+ echo $INPUT_COMMAND
7+ echo $INPUT_OPTIONS
8+
9+ SUPPORTED_COMMANDS=(" /review" )
10+
11+ INPUT_COMMAND=$( echo " $INPUT_COMMAND " | tr -d ' [:space:]' )
12+ for command in " ${SUPPORTED_COMMANDS[@]} " ; do
13+ if [ " $command " = " $INPUT_COMMAND " ]; then
14+ valid_command=true
15+ break
16+ fi
17+ done
18+
19+
20+ # Run the Docker container from the specified image
21+ if [ " $valid_command " = true ]; then
22+ exec docker run bitoai/cra:latest --mode=cli --pr_url $INPUT_PR $INPUT_COMMAND $INPUT_OPTIONS
23+ else
24+ echo " $INPUT_COMMAND is not supported"
25+ exit 0 # Exit the script with a non-zero status code
26+ fi
You can’t perform that action at this time.
0 commit comments