Understanding Web Hooks
Web Hook is a method of receiving notifications of events occurring in web applications. When something happens in an application that supports Web Hooks, it requests the configured URL by sending details of what happened.
This technique allows you to perform application integrations with others or even extend the functionality of the same in a totally uncoupled way, without having to modify the application, inject some kind of code or script, etc.
Therefore, this will not send the repository directly to Github or any other website. It is up to you to build an application that listens to events and takes the desired action, in case, clone the repository.
Checking which event to use
To current documentation shows what events are generated and what content the configured URL will receive.
For example, the first case is when someone updates the repository by making a push
. The configured URL will receive an HTTP request with the header (header) X-Gitlab-Event
worthwhile Push Hook
. The body of the request will contain details about the changes, such as the user who made the push
and which commits were sent.
Implementing your application
At the end of the documentation there is an example of how to implement an application that listens to events. You should do something similar.
It can be in any language with any framework, but you will be responsible for the system that listens to events in the specified URL.
Upon receiving an event-originated request push
, your application should then clone the source repository (Gitlab) and do the push
destination no (Github).
Why do the downvotes?
– Yamaneko