Wouldn't quick sanity checks like these make more sense in a git push hook?
No reason to wait for the CI. There's also the risk of broken intermediary commits unless the CI check each and every commit in isolation.
No reason to wait for the CI. There's also the risk of broken intermediary commits unless the CI check each and every commit in isolation.
It denies all pushes which doesn't meet the specified requirements with an error message, and the end user has to re-do the commit and push again.
This is likely how your authorization is done today already.
The alternative would be a pre-commit hook, but that runs when crafting the commit, and under the control of the end user. That can make for a better user experience since it runs even earlier in the process but isn't necessarily secure. Of course, one can have both.