Skip to content

Commit

Permalink
docs: adjust script to handle zero unused images DOC-1232 (#4459)
Browse files Browse the repository at this point in the history
  • Loading branch information
addetz authored Oct 24, 2024
1 parent 03ca0c4 commit 1e6cf0c
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions .github/workflows/clean-up-unused-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,16 @@ jobs:
- name: Create PR with unused images
run: |
unused_image_count=$(wc -l < unused_images.json)
if unused_image_count == 0; then
"No images found to remove."
exit 0
file="unused_images.json"
if [[ -f "$file" ]]; then
unused_image_count=$(wc -l < "$file")
if [ "$unused_image_count" -eq 0 ]; then
echo "No images found to remove."
exit 0
fi
else
echo "File $file not found."
exit 1
fi
# Ensure that we are on master.
Expand Down

0 comments on commit 1e6cf0c

Please sign in to comment.