Does anyone know if there is a mechanism in GitHub:Enterprise to set up a general post-receive hook that will apply to all repositories (including new ones as soon as they are created?)
I am trying to develop a link to a secondary system that will want to get notified of all pushes to all repositories, and requiring manual set-up for each new repository will just be a matter of time before it gets forgotten.
Git hooks are scripts that Git executes before or after commit, push, and receive. Setting up a Git hook makes your development and deployment easy. In this article, you will learn how to create a post-receive Git hook that executes when you use the git push command.
Pre-receive hooks enforce rules for contributions before commits may be pushed to a repository. Pre-receive hooks run tests on code pushed to a repository to ensure contributions meet repository or organization policy. If the commit contents pass the tests, the push will be accepted into the repository.
You can test a pre-receive hook script locally before you create or update it on your GitHub Enterprise Server instance.
I know that this is really old, but GitHub Enterprise 2.6 just came out with pre-receive hooks. More information can be learned here: https://help.github.com/enterprise/admin/guides/developer-workflow/using-pre-receive-hooks-to-enforce-policy/.
This should answer the question originally posted, as this is something that gets set up at an instance level (thus, it is only on GitHub Enterprise) and will work for all repositories.
I am trying to develop a link to a secondary system that will want to get notified of all pushes to all repositories, and requiring manual set-up for each new repository will just be a matter of time before it gets forgotten.
As for this piece, another thing you could look into would be log forwarding on GitHub. You can read about log forwarding here: https://help.github.com/enterprise/admin/articles/log-forwarding. You can also control multiple log forwarding destinations as of version 2.6
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With