Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub:Enterprise post-receive hook

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.

like image 445
jerryjvl Avatar asked Aug 30 '12 01:08

jerryjvl


People also ask

Do Git hooks get pushed?

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.

What is pre-receive hook GitHub?

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.

Does GitHub support server side hooks?

You can test a pre-receive hook script locally before you create or update it on your GitHub Enterprise Server instance.


1 Answers

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

like image 157
brntbeer Avatar answered Oct 12 '22 23:10

brntbeer