2017 © Pedro Peláez
 

library webhooker

Github Webhook Helper

image

roarbb/webhooker

Github Webhook Helper

  • Friday, January 9, 2015
  • by roarbb
  • Repository
  • 2 Watchers
  • 1 Stars
  • 4 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Installation

The recommended way to install Webhooker is through Composer., (*1)

# Install Composer
curl -sS https://getcomposer.org/installer | php

Next, run the Composer command to install the latest stable version of Webhooker:, (*2)

composer require roarbb/webhooker

Prerequisites

Make sure that you have rights to update files on server, (*3)

chown -R www-data /path/to/website/root

Webhook config

Step 1

In website root, create webhook.php file, (*4)

basic

<?php

use Webhook\Hook;

include_once('vendor/autoload.php');

$hook = new Hook();
echo $hook->pull();

If you want to secure your webhook with secret token (token in file)

webhook.php, (*5)

<?php

use Webhook\Hook;

include_once('vendor/autoload.php');

$hook = new Hook();
$hook->setConfigFile(__DIR__ . '/config.neon');

if ($hook->isValidSignature()) {
    echo $hook->pull();
}

config.neon, (*6)

github:
    secret: secretToken123

If you want to secure your webhook with secret token (token as string)

webhook.php, (*7)

<?php

use Webhook\Hook;

include_once('vendor/autoload.php');

$hook = new Hook();
$hook->setGithubSecret('secretToken123');

if ($hook->isValidSignature()) {
    echo $hook->pull();
}

Step 2

Login to github, and set up your webhook. Link: https://github.com/[username]/[repository]/settings/hooks, (*8)

add-webhook, (*9)

Payload Url: Link to your webhook.php
Content Type: application/json
Secret: secretToken123
Which events would you like to trigger this webhook? - Just the push event.
Active: checked, (*10)

It may looks like this: webhook-config, (*11)

Final Step

On producion server: * Double-check permissions * Don't forget to run composer update, (*12)

You can check your automatic updates in Webhooks/Manage Webhook -> Recent Deliveries webhook-payload, (*13)

Enjoy your new workflow!

The Versions

09/01 2015

dev-master

9999999-dev https://github.com/roarbb/webhooker

Github Webhook Helper

  Sources   Download

MIT

The Requires

 

github webhook