Skip to content

Commit 2645a1a

Browse files
committed
Pass the job if no warnings
1 parent 3c37768 commit 2645a1a

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

script.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ docker_files=$(git ls-files --exclude='*Dockerfile*' --ignored --cached)
5252
for docker_file in "${docker_files[@]}" ; do
5353
export DOCKER_FILE_PATH=${docker_file}
5454
check_result=$(docker build -f "${docker_file}" --call=check,format=json . || true)
55+
if [[ -z echo "$check_result" | jq '.warnings // empty' ]]; then
56+
echo "No warnings found in ${docker_file}"
57+
continue
58+
fi
5559
echo "$check_result" | jq "$docker_build_jq" \
5660
| reviewdog -f=rdjson -name="docker-build-check" \
5761
-reporter="${INPUT_REPORTER}" \
File renamed without changes.

testdata/Dockerfile.without-warnings

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
FROM alpine

0 commit comments

Comments
 (0)