Skip to content

Update of the tutorials #1142

Update of the tutorials

Update of the tutorials #1142

name: 'File Size Checker'
on: [push, pull_request]
jobs:
check-file-size:
runs-on: ubuntu-latest
steps:
- name: 'Checkout code'
uses: actions/checkout@v4
- name: 'Check file size'
run: |
# Set the maximum file size to 1 MB
MAX_SIZE=1048576
# Find all files in the repository excluding .git directory, and handle spaces in file names
find . -type f ! -path './.git/*' -print0 | while IFS= read -r -d '' FILE; do
SIZE=$(wc -c <"$FILE")
if [ "$SIZE" -gt "$MAX_SIZE" ]; then
echo "Error: $FILE exceeds the maximum file size limit of 1 MB."
exit 1
fi
done
echo "All files are within the size limit."
permissions: read-all