Skip to content

Commit

Permalink
Modify the handling of detected warnings to only prompt. (#688)
Browse files Browse the repository at this point in the history
Signed-off-by: zepan <[email protected]>
  • Loading branch information
ZePan110 committed Aug 30, 2024
1 parent dba908a commit e6f5d13
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/scripts/codeScan/hadolint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,24 @@

source /GenAIExamples/.github/workflows/scripts/change_color
log_dir=/GenAIExamples/.github/workflows/scripts/codeScan
ERROR_WARN=false

find . -type f \( -name "Dockerfile*" \) -print -exec hadolint --ignore DL3006 --ignore DL3007 --ignore DL3008 --ignore DL3013 {} \; 2>&1 | tee ${log_dir}/hadolint.log
find . -type f \( -name "Dockerfile*" \) -print -exec hadolint --ignore DL3006 --ignore DL3007 --ignore DL3008 --ignore DL3013 {} \; > ${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
echo $(grep "error" ${log_dir}/hadolint.log)
ERROR_WARN=true
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
echo $(grep "warning" ${log_dir}/hadolint.log)
ERROR_WARN=true
fi

if [ "$ERROR_WARN" = true ]; then
echo $ERROR_WARN
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
Expand Down

0 comments on commit e6f5d13

Please sign in to comment.