mirror of
https://github.com/actions/runner-images.git
synced 2025-12-11 03:27:05 +00:00
21 lines
647 B
Bash
21 lines
647 B
Bash
#!/bin/bash -e
|
|
################################################################################
|
|
## File: validate-disk-space.sh
|
|
## Desc: Validate free disk space
|
|
################################################################################
|
|
|
|
availableSpaceMB=$(df / -hm | sed 1d | awk '{ print $4}')
|
|
minimumFreeSpaceMB=15000
|
|
|
|
echo "Available disk space: $availableSpaceMB MB"
|
|
|
|
if [ $RUN_VALIDATION != "true" ]; then
|
|
echo "Skipping validation disk space..."
|
|
exit 0
|
|
fi
|
|
|
|
if [ $availableSpaceMB -le $minimumFreeSpaceMB ]; then
|
|
echo "Not enough disk space on the image (minimum available space: $minimumFreeSpaceMB MB)"
|
|
exit 1
|
|
fi
|