PHPackages                             dintel/php-github-webhook - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. dintel/php-github-webhook

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

dintel/php-github-webhook
=========================

Simple class for handling GitHub webhook calls

0.2.0(9y ago)5115.5k↓46.2%12BSD-3-ClausePHPPHP &gt;=5.4

Since Mar 22Pushed 9y ago5 watchersCompare

[ Source](https://github.com/dintel/php-github-webhook)[ Packagist](https://packagist.org/packages/dintel/php-github-webhook)[ RSS](/packages/dintel-php-github-webhook/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (5)Used By (0)

PHP GitHub webhook package
==========================

[](#php-github-webhook-package)

Overview
--------

[](#overview)

This package contains classes that allow keeping up to date git repository by performing `git pull` on every `git push` to your GitHub repository. To achieve this you have to add simple script to your git repository and configure webhook on your GitHub repository.

Webhook script
--------------

[](#webhook-script)

For a webhook script to work you have to do 3 things:

1. Add this package to your composer dependencies
2. Add a simple PHP script that will actually handle calls to webhook
3. Configure your GitHub repository webhook to be called every time commits are pushed to GitHub

### Composer

[](#composer)

To add dependency, simply edit your `composer.json` and add to your `require`block following dependency - `"dintel/php-github-webhook": "0.1.*"`. This is the simplest way to bring php-github-webhook libraries into your project.

### Webhook script

[](#webhook-script-1)

To actually handle webhook calls, you have to add PHP script that will be accessible publicly and it will run `git pull` every time GitHub calls it. A simplest example of such webhook script:

```
