From 415c497c049993a21459e690508b4cd3f30c2ed8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 22 Nov 2024 02:02:53 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .github/workflows/scripts/check_cmd_injection.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/scripts/check_cmd_injection.sh b/.github/workflows/scripts/check_cmd_injection.sh index 87f4596d7..9e4b8d2e1 100644 --- a/.github/workflows/scripts/check_cmd_injection.sh +++ b/.github/workflows/scripts/check_cmd_injection.sh @@ -26,21 +26,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