Skip to content

Commit

Permalink
Create filesize.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
hrvolapeter authored Sep 5, 2024
1 parent 3299dc7 commit a90e295
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions .github/workflows/filesize.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: File size check
on: [pull_request]
jobs:
File-Size:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 2
- name: check size
shell: bash
run: |
CHANGED=`git diff --name-only -r HEAD^1 HEAD`
FAIL=0
while IFS= read -r line; do
SIZE=`find -maxdepth 1 -name "$line" -size +2M`
if [ "$SIZE" ]; then
echo -n "File too large: " `du -h $line`
FAIL=1
fi
done <<< "$CHANGED"
exit $FAIL

0 comments on commit a90e295

Please sign in to comment.