App-KGB

 view release on metacpan or  search on metacpan

script/kgb-bot  view on Meta::CPAN

    my $json;
    my $ok = eval {
        $json = JSON::from_json( $request->content, { utf8 => 1 } );
        1;
    };

    unless ($ok) {
        return webhook_error(@_, 'Error decoding JSON body', undef, $@);
    }

    KGB->debug('Body decoded');

    unless (
            $json
        and ref($json)
        and ref($json) eq 'HASH'
        and (   $json->{project}
            and defined $json->{project}{name}
            and length $json->{project}{name}
            or defined $json->{project_name} and length $json->{project_name} )
        and defined $json->{object_kind}

script/kgb-bot  view on Meta::CPAN

                    $stash);
            }
        }
    }
}

=head2 gitlab_webhook_push

Handle a gitlab webhook call for the C<push> event (branch update).

Expects the body of the POST request (decoded, as a hash reference) in I<ARG0>
and all the request parameters in I<ARG1>.

The request is expected to conform to the GitLab webhook documentation at
L<https://salsa.debian.org/help/user/project/integrations/webhooks.md#push-events>.

The request parameters should look like the result of the CGI's param() method.

Supported parameters (?param=value&param=value2...)

=over



( run in 0.237 second using v1.01-cache-2.11-cpan-26ccb49234f )