-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Github Action to prevent large files #1478
Conversation
4975833
to
e2bad45
Compare
9ff008d
to
e2bad45
Compare
e2bad45
to
76b3676
Compare
does not check for accidental LFS files, just rooting for other stuff in CI breaking then ;) |
result=0 | ||
while read -d '' -r file; do | ||
if [[ -f "$file" ]]; then | ||
actualsize=$(wc -c <"$file") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not that it really matters for this use-case, but stat should be a lot faster since it uses the filesystem rather than wc which I think is actually consuming the file stream characters from the input pipe.
actualsize=$(wc -c <"$file") | |
actualsize=$(stat -c%s "$file") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know nothing about these. Will do :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
stat doesn't have that size filtering option on my mac it seems. I'll leave it be
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yet another reason to do this in Python
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any particular reason for doing this as bash instead of python?
Should have done python given that I spent soo much time figuring it out. Story is that I first had it in its own job and didn't want to install python. Then moved it into the util job which already has it but didn't convert it |
Part of #1403
Checklist