-
Notifications
You must be signed in to change notification settings - Fork 43
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
Git commit/push rule to not allow big files #77
Comments
Question on StackOverflow, without a real answer yet, though. However, after some short research, I think sth like this could work: 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). |
I have put some initial code for a GitHub action using adobe/sizewatcher but I'm not really sure whether that can work. Some issue: adobe/sizewatcher#79 Maybe this can not really work like this. The GitHub action runs for pushes, but actually only after the push already has been done, but then it is too late already. It should check it before the push completes and the push itself should fail if this check fails. I'm not sure this is really possible. I think sizewatcher actually expects that this is done for PRs and it compares to the master branch. Then we would only allows PRs where these checks are passing, and also we would not allow direct pushes to the master branch anymore. |
I also asked for such a feature now in the official GitHub community forum. |
We want to avoid #76 in the future.
One idea was to not allow any files >=10kb (arbitrary limit; but in general, any big files) and enforce that via some Git push hook or so. I'm not sure what methods we have here.
The text was updated successfully, but these errors were encountered: