Skip to content

Commit 82fa21b

Browse files
committed
Only provide test_images_report if folder isn't empty
1 parent 19b2d92 commit 82fa21b

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

.github/workflows/build-docker-artifacts.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ jobs:
296296
vuln-type: "os,library"
297297
severity: ${{ steps.set_severity.outputs.severity }}
298298
# The cache update takes quite long, so let's try to disable it for now: https://github.com/aquasecurity/trivy-action#cache
299-
cache: 'false'
299+
cache: "false"
300300
continue-on-error: false
301301

302302
- name: Push image
@@ -353,15 +353,17 @@ jobs:
353353
export "IMAGE_${name_upper}=${image_ref}"
354354
done;
355355
356-
# Create report folder to avoid any downstream Docker volume issues
357-
# TODO: For some reason this doesn't work yet, i.e. if a docker-compose script mounts a volume here, nothing shows up...
356+
# Create a directory to store the report results
358357
mkdir -p "$test_images_report"
359-
chmod 777 "$test_images_report"
360-
echo "test_images_report=${test_images_report}" >> "$GITHUB_OUTPUT"
361358
362359
echo "Run $test_images_hook"
363360
chmod +x "$test_images_hook"
364361
bash "$test_images_hook"
362+
363+
# If the report folder is not empty, we store it as output
364+
if [[ -n "$(ls -A "$test_images_report")" ]]; then
365+
echo "test_images_report=${test_images_report}" >> "$GITHUB_OUTPUT"
366+
fi
365367
else
366368
echo "No $test_images_hook found, skipping tests."
367369
fi

0 commit comments

Comments
 (0)