diff --git a/script.sh b/script.sh index 7b461ec..ae65ef1 100755 --- a/script.sh +++ b/script.sh @@ -55,6 +55,11 @@ for docker_file in "${docker_files[@]}" ; do echo "::group:: result of build --check" echo "$check_result" echo "::endgroups::" + warnings=$(echo "$check_result" | jq '.warnings') + if [[ "$warnings" == "null" ]]; then + echo "No warnings found in ${docker_file}" + continue + fi echo "$check_result" | jq "$docker_build_jq" \ | reviewdog -f=rdjson -name="docker-build-check" \ -reporter="${INPUT_REPORTER}" \ diff --git a/testdata/no_warnings/Dockerfile b/testdata/no_warnings/Dockerfile new file mode 100644 index 0000000..67fd379 --- /dev/null +++ b/testdata/no_warnings/Dockerfile @@ -0,0 +1 @@ +FROM alpine diff --git a/testdata/Dockerfile b/testdata/warnings/Dockerfile similarity index 100% rename from testdata/Dockerfile rename to testdata/warnings/Dockerfile