Skip to content

Commit e6f5d13

Browse files
authored
Modify the handling of detected warnings to only prompt. (#688)
Signed-off-by: zepan <ze.pan@intel.com>
1 parent dba908a commit e6f5d13

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

.github/workflows/scripts/codeScan/hadolint.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,24 @@
55

66
source /GenAIExamples/.github/workflows/scripts/change_color
77
log_dir=/GenAIExamples/.github/workflows/scripts/codeScan
8+
ERROR_WARN=false
89

9-
find . -type f \( -name "Dockerfile*" \) -print -exec hadolint --ignore DL3006 --ignore DL3007 --ignore DL3008 --ignore DL3013 {} \; 2>&1 | tee ${log_dir}/hadolint.log
10+
find . -type f \( -name "Dockerfile*" \) -print -exec hadolint --ignore DL3006 --ignore DL3007 --ignore DL3008 --ignore DL3013 {} \; > ${log_dir}/hadolint.log
1011

1112
if [[ $(grep -c "error" ${log_dir}/hadolint.log) != 0 ]]; then
1213
$BOLD_RED && echo "Error!! Please Click on the artifact button to download and check error details." && $RESET
13-
exit 1
14+
echo $(grep "error" ${log_dir}/hadolint.log)
15+
ERROR_WARN=true
1416
fi
1517

1618
if [[ $(grep -c "warning" ${log_dir}/hadolint.log) != 0 ]]; then
1719
$BOLD_RED && echo "Warning!! Please Click on the artifact button to download and check warning details." && $RESET
20+
echo $(grep "warning" ${log_dir}/hadolint.log)
21+
ERROR_WARN=true
22+
fi
23+
24+
if [ "$ERROR_WARN" = true ]; then
25+
echo $ERROR_WARN
1826
exit 1
1927
fi
2028
$BOLD_PURPLE && echo "Congratulations, Hadolint check passed!" && $LIGHT_PURPLE && echo " You can click on the artifact button to see the log details." && $RESET

0 commit comments

Comments
 (0)