Skip to content

Commit fe38bdf

Browse files
committed
.github: fix removal of all files in /mnt
Use find to ignore swapfile and avoid error in case of permission denied. Fixes: 0cd21f9 (".github: remove all contents of /mnt in build images CI") Signed-off-by: André Martins <andre@cilium.io>
1 parent 0cd21f9 commit fe38bdf

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

.github/workflows/build-images-ci.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ jobs:
9999
echo "# Hidden files in /mnt:"
100100
sudo du --human-readable -- /mnt/.* 2>/dev/null
101101
fi
102-
echo "# Removing all contents of /mnt"
103-
sudo rm -rf /mnt/*
104-
sudo rm -rf /mnt/.*
102+
echo "# Removing all contents of /mnt except /mnt/swapfile"
103+
sudo find /mnt -mindepth 1 ! -path /mnt/swapfile -exec rm -rf {} + || true
105104
106105
- name: Setup docker volumes into /mnt
107106
# This allows us to make use of all available disk.

0 commit comments

Comments
 (0)