When you configure Github webhooks, you open a lot of opportunities and make the development process easier. They are used to update backup mirror or external issue tracker, trigger CL builds and deploy changes to the production server.
Once you install the webhook, it will be triggered by a specific event like pull request or code push. Generally, webhooks allow you to automate a lot of processes, so you don't have to manually apply changes to the live.
So, in this article, you will learn how to add webhook in Github.
Let's start.
To add webhook in Github:
1. Navigate to your Github account.
2. Choose the repository which you want to configure the webhooks for and go to the Settings.
3. Go to the Webhooks tab and press the Add webhook button.
4. Set the Payload URL, Content type and Secret to set up webhook in Github.
- Payload URL — server URL where the webhook requests will be sent.
- Content type — the type of delivering webhook requests to the payload URL
- Secret — "password" used to ensure that the requests sent to payload URL are from Github.
5. Choose which Events you want webhook to be triggered with. You can trigger the webhook with the push event, individual events or everything.
6. Once you finish, press the Add Webhook button to add it.
Note: you can create up to 20 webhooks for different events that will trigger.
So that's it. Now you should be able to automate the requests and eliminate the manual code pushing.