Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setup GitHub Webhook for AWS EC2 server

I have a web application deployed in an AWS EC2 instance. I recently learnt about GitHub Webhooks and I am now trying to setup a webhook service for my EC2 server.

I have two questions:

  1. How can I receive the webhook payload to a specific endpoint on my server?
  2. What will be the payload URL that I have to provide when setting up the GitHub webhook?
like image 490
tyson Avatar asked Jul 30 '26 16:07

tyson


1 Answers

First you need to go to your repo, and click through this sequence:

Settings -> Webhooks & Services -> Add webhook

Then paste the url where github will submit data for each new commit. You can find examples of payload in example.

Then implement the logic needed in the backend to work with info about new commits.

like image 171
vanadium23 Avatar answered Aug 02 '26 07:08

vanadium23