Skip to content
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

A size checker action which checks for files > 100KB. #40

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bayliffe
Copy link
Contributor

@bayliffe bayliffe commented Jan 2, 2024

If any files being added or changed by a pull request are larger in size than 100KB this test will fail, raising an error that lists files that exceed this threshold size. A warning annotation will be added for files that exceed 50KB.

This was tested using files that have been removed from the history to avoid swelling the repository size. First the annotation when a file exceeds 50KB.

image

And with two files that exceed 50KB:

image

And with an additional file that exceeds the hard limit of 100KB:

image

@bayliffe bayliffe force-pushed the size_check_action branch 2 times, most recently from 7790bc1 to 1afc227 Compare January 2, 2024 15:56
If any files being added or changed by a pull request are larger in size
than 100KB this test will fail and print the list of files that exceed
this threshold size.
@bayliffe
Copy link
Contributor Author

bayliffe commented Jan 2, 2024

@cpelley this is perhaps a little clumsy and the test should be put into a script file. Very open to suggestions as this is my first foray into github actions.

@bayliffe bayliffe requested a review from cpelley January 2, 2024 16:16
@cpelley
Copy link

cpelley commented Jan 4, 2024

Hey Ben. Gosh I didn't think you would get to this so quickly!
I would suggest that instead we utilise the check-added-large-files pre-commit check which stops large files from being committed at all. The github actions can then also run the pre-commit checks (as done in improver_suite).

improver_suite is a suitable reference for how pre-commits are setup and how they are also run via github actions. I can put together a PR targeting your branch if you prefer?

@cpelley
Copy link

cpelley commented Jan 4, 2024

I should say, we can go with your approach first and do the pre-commit later, since you have done the work already.
Up to you. What you think?

@bayliffe bayliffe self-assigned this Jan 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants