(Translated by https://www.hiragana.jp/)
GitHub - xtaran/CGI-Github-Webhook: Easy to use Perl backend for GitHub webhooks
Skip to content

xtaran/CGI-Github-Webhook

Repository files navigation

CGI::Github::Webhook

Build Status Coverage Status Kwalitee status CPAN version

Packaging status

An easy to use module for writing CGI-based Github webhook backends in Perl.

In most cases three statements already suffice. Configure a script to trigger, a shared secret and a log file and you're ready to go.

It also supports updating Shields.io-like status badges depending on the trigger script's return code (or fork success/fail).

Synopsis

#!/usr/bin/perl

use CGI::Github::Webhook;

my $ghwh = CGI::Github::Webhook->new(
    mime_type => 'text/plain',
    trigger => '/srv/some-github-project/bin/deploy.pl',
    trigger_backgrounded => 1,
    secret => 'use a generated password here, nothing valuable',
    log => '/srv/some-github-project/log/deployment.log',
    badge_to => '/srv/some-github-project/htdocs/status.svg',
);
$ghwh->run();

Motivation

The module has been written over the frustration of not getting GitHub::WebHook to work together with CGI.pm.

It's first incarnation has been written as single CGI script powering a webhook for the Debian Package Management Book to trigger builds of the e-book variants and their deployment upon every push.

Author, License and Copyright

Copyright 2016 Axel Beckert abe@deuxchevaux.org.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation, either version 1, or (at your option) any later version; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

The badges in the static-badges directory are licensed under the CC0 Public Domain Dedication and not copyrighted.