GithubHelp home page GithubHelp logo

github-webhooks's Introduction

Github WebHooks 2.0.0 Build Status Latest Stable Version

Github Webhooks Library (with events support).

Introduction

This library aims to provide:

  • A simple and embeddable event-based library

  • A handy stand-alone server class

  • An event listener to perform git pull

    • Support multiple deploy key
    • NOTE: Linux only

Requirements

  • php >=5.3.3

Optionally:

  • git (to use the Pull event listener)

Installation

Using composer:

Add the following to your composer.json file:

"require": {
    "pruno/github-webhooks": "2.0.*",
},
"repositories": [
    {
        "type": "vcs",
        "url": "https://github.com/pruno/github-webhooks.git"
    }
]

Alternately with git submodules:

git submodule add https://github.com/pruno/github-webhooks.git pruno/github-webhooks

Quick implementation (Pull on Push event)

1 - Create a Github Webhook:

 - Set an arbitrary URL path (this will be your hook id) 
   (e.g: https://example.com/POSTRECEIVE)
 - Both payload versions are supported.
 - The push event is enough.

1 - Copy sample/composer.json to your project root directory.

2 - Run composer install.

3 - Copy sample/index.php to your public directory.

4 - Edir sample/index.php with:

 - hook information (line 9).
 - git working copy information (line 14).

5 - You may remove line 12 once finished.

Notice:
Remember that the user who is running your webserver (or fast-cgi process) need to have write permissions on your git working copy.

Embedding

Refer to library/GithubWebhooks/Server.php as an example implementation.

Contribute

Please do. Fork it and send pull requests.

License

This software is released under the New-BSD License.

github-webhooks's People

Contributors

pruno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.