PHP code example of highsolutions / github-hook

1. Go to this page and download the library: Download highsolutions/github-hook library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

highsolutions / github-hook example snippets


'providers' => [
    // ...
    HighSolutions\GitHubHook\GitHubHookServiceProvider::class,
];



olutions\GitHubHook\Services\GitHubHookService::simpleInit([
    'secret' => null, // secret of webhook
    'branch' => 'master', // branch name
    'path' => '/home/www/', // absolute path to the repo
], $_POST['payload'], $_SERVER['x-hub-signature'], [
    'composer' => 'composer install --no-dev',
]);



bash
php artisan vendor:publish --provider="HighSolutions\GitHubHook\GitHubHookServiceProvider"
bash
GITHUB_HOOK_URL=/github/hook/
GITHUB_HOOK_BRANCH=master
GITHUB_HOOK_SECRET=
GIHUB_HOOK_BEFORE="php artisan help###php artisan help"
GITHUB_HOOK_HOOK_MIGRATION="php artisan migrate --force"
GITHUB_HOOK_HOOK_SEED="php artisan db:seed --force"
GITHUB_HOOK_HOOK_REFRESH="php artisan migrate:refresh --seed --force"
GITHUB_HOOK_HOOK_COMPOSER="php composer.phar install --no-dev"
GITHUB_HOOK_HOOK_CACHE="php artisan cache:clear"
GITHUB_HOOK_HOOK_VIEW="php artisan view:clear"
GIHUB_HOOK_AFTER="php artisan help###php artisan optimize"
GITHUB_HOOK_HOOK_SENDER=GitHub
GITHUB_HOOK_SLACK_CHANNEL=
GITHUB_HOOK_SLACK_URL=