Fix code scan warning (#473)

Signed-off-by: zepan <ze.pan@intel.com>
This commit is contained in:
ZePan110
2024-08-02 09:31:30 +08:00
committed by GitHub
parent c71bc68c9c
commit ac89855ff8
17 changed files with 61 additions and 48 deletions

View File

@@ -6,12 +6,16 @@
source /GenAIExamples/.github/workflows/scripts/change_color
log_dir=/GenAIExamples/.github/workflows/scripts/codeScan
find . -type f \( -name "Dockerfile*" \) -print -exec hadolint --ignore DL3006 --ignore DL3007 --ignore DL3008 {} \; 2>&1 | tee ${log_dir}/hadolint.log
find . -type f \( -name "Dockerfile*" \) -print -exec hadolint --ignore DL3006 --ignore DL3007 --ignore DL3008 --ignore DL3013 {} \; 2>&1 | tee ${log_dir}/hadolint.log
if [[ $(grep -c "error" ${log_dir}/hadolint.log) != 0 ]]; then
$BOLD_RED && echo "Error!! Please Click on the artifact button to download and check error details." && $RESET
exit 1
fi
if [[ $(grep -c "warning" ${log_dir}/hadolint.log) != 0 ]]; then
$BOLD_RED && echo "Warning!! Please Click on the artifact button to download and check warning details." && $RESET
exit 1
fi
$BOLD_PURPLE && echo "Congratulations, Hadolint check passed!" && $LIGHT_PURPLE && echo " You can click on the artifact button to see the log details." && $RESET
exit 0