GitHub::WebHook - Collection of GitHub WebHook handlers
Create new webhook handler (or use one of the existing "MODULES"):
package GitHub::WebHook::Example; use parent 'GitHub::WebHook'; sub call { my ($payload, $event, $id, $logger) = @_; ... $logger->{info}->("processing some $event with $id"); 1; # success }
Build a receiver script with Plack::App::GitHub::WebHook:
use Plack::App::GitHub::WebHook; Plack::App::GitHub::WebHook->new( hook => 'Example' )->to_app;
GitHub::Webhook provides handlers that receive webhooks in GitHub WebHooks format or similar forms.
The module can be used with Plack::App::GitHub::WebHook to create webhook receiver scripts, but it can also be used independently.
A Perl module in the GitHub::WebHook namespace is expected to implement a method named call which is called with the following parameters:
call
The encoded webhook payload
The type of webhook event e.g. pull
pull
A unique delivery ID
A logger object as (possibly blessed) HASH reference with properties debug, info, warn, error, fatal, each being a CODE reference to send log messages to.
debug
info
warn
error
fatal
run a subprocess
clone/pull from a git repository
Copyright Jakob Voss, 2015-
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install GitHub::WebHook, copy and paste the appropriate command in to your terminal.
cpanm
cpanm GitHub::WebHook
CPAN shell
perl -MCPAN -e shell install GitHub::WebHook
For more information on module installation, please visit the detailed CPAN module installation guide.