GitHub documentation on large files states:
If you attempt to add or update a file that is larger than 50 MB, you will receive a warning from Git.
GitHub blocks pushes that exceed 100 MB.
I want to configure it in a way that it blocks any pushes with files larger than some predefined threshold (e.g. 100kb).
Is this possible? How?
Maybe via the branch protection rules? I saw some examples that the branch protection rules can include custom status checks. The status checks, these are GitHub actions? So I could maybe add a custom GitHub CI action which checks for a valid commit (valid = any changed file is below the size limit).
Maybe it's not really possible yet. I also asked in the official community forum.
(Note: If possible, I would prefer a pure-Git answer, independent of GitHub. With pure Git, this is possible via a server-side pre-receive
hook. See here. However, on GitHub, I cannot have a custom pre-receive hook, so this is not an option.)