Github: Webhooks

Karthiksharma
2 min readMay 15, 2022

what exactly is a webhook?

A webhook (also called a web callback or HTTP push API) is a way for an app to provide other applications with real-time information. A webhook delivers data to other applications as it happens, meaning you get data immediately. Unlike typical APIs where you would need to poll for data very frequently in order to get it real-time. This makes webhooks much more efficient for both provider and consumer. The only drawback to webhooks is the difficulty of initially setting them up.

Lets Understand:

if you want to do following things. while you push the code on github automatically. then webhook can help you.

  1. suppose you want to send email to 100 people when you push.
  2. want to notify other people.
  3. upload you commit details to your personal database.
  4. trigger any pipeline.

and there are many other use cases also, in which you can use webhook.

Steps:

  1. In your code write one POST API and in that function write the code that you want to run automatically when you push code on Github.
  2. deploy that url on web.
  3. go to settings > webhooks
  4. in the webhooks provide that POST API URL.

--

--

Karthiksharma

I’m a Mobile Developer enthusiast & a junior pursuing my Bachelors in Computer Science . I am passionate about Data Structure, Web Dev, Machine Learning.