On 18 August 2017 at 01:00, Pranay B <pranay.b...@gmail.com> wrote: > > I am trying to follow the approach listed in below link found at Git > documentation website but it seems not to be working. > *https://git-scm.com/book/en/v2/Customizing-Git-An-Example-Git-Enforced-Policy > <https://git-scm.com/book/en/v2/Customizing-Git-An-Example-Git-Enforced-Policy>* > > Github provides webhooks that gets triggered when we perform git > operations but is there any way to stop/undo/modify commits based on > Pull/Push requests before they get committed on Github? Since all the > codebase is present on Github I am trying to set a filter to monitor > requests being made to Github. > For instance, a Pull request should get cancelled if JIRA# is not > mentioned in the PR template/ description. >
I think you want to stop pushes to github and not pull request and you should make make a pre-push hook >From https://git-scm.com/book/gr/v2/Customizing-Git-Git-Hooks: " The pre-push hook runs during git push, after the remote refs have been updated but before any objects have been transferred. It receives the name and location of the remote as parameters, and a list of to-be-updated refs through stdin. You can use it to validate a set of ref updates before a push occurs (a non-zero exit code will abort the push). " Regards Martin -- You received this message because you are subscribed to the Google Groups "Git for human beings" group. To unsubscribe from this group and stop receiving emails from it, send an email to git-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.