diff --git a/.github/workflows/scripts/check_cmd_injection.sh b/.github/workflows/scripts/check_cmd_injection.sh index 8408d3bc5..dc9af7d03 100644 --- a/.github/workflows/scripts/check_cmd_injection.sh +++ b/.github/workflows/scripts/check_cmd_injection.sh @@ -27,21 +27,21 @@ do fi # get added command git diff main ${file} | grep "^\+.*" | grep -v "^+++" | sed "s|\+||g" > ${WORKSPACE}/diff_file - #cat diff_file | while read line; do - # echo $line; - # for (( i=0; i<${#check_list[@]}; i++)); do + #cat diff_file | while read line; do + # echo $line; + # for (( i=0; i<${#check_list[@]}; i++)); do # if [[ $line == *"${check_list[$i]}"* ]]; then # echo "Found Dangerous Command: $line in $file, Please Check" # status="failed" - # fi; - # done; + # fi; + # done; #done - for (( i=0; i<${#check_list[@]}; i++)); do + for (( i=0; i<${#check_list[@]}; i++)); do if [[ $(cat diff_file | grep -c "${check_list[$i]}") != 0 ]]; then echo "Found Dangerous Command: $line in $file, Please Check" status="failed" - fi; - done; + fi; + done; done [[ -f ${WORKSPACE}/diff_file ]] && rm -f ${WORKSPACE}/diff_file [[ $status == "failed" ]] && exit 1 || exit 0