I am trying to protect my github repo from some specific pushes (e.g. pushes with conflict markers like <<<<<
).
At first, I tried to write a pre-commit git hook to block those specific commits. Then realized github repositories doesn't accept pre-commit hooks and I have to install them on client side for every contributor.
This is not a neat solution because someone might forget to install hooks after clone. It is also possible to override pre-commit hooks.
Then I learned about github webhooks. They can notify via payloads during pushes on the repository.
Is it possible to examine and block pushesh through webhooks?