Module egithub_webhook

Implements the code to handle GitHub's webhook events.

This module defines the egithub_webhook behaviour.
Required callback functions: handle_pull_request/3, handle_error/3.

Description

Implements the code to handle GitHub's webhook events. All callbacks defined map to a specific GitHub event, for example the handle_pull_request callback is used for pull_request events. It also offers the option of reporting the progress of your webhook handler through the Statused API functions, by using the event/6 function.

Data Types

file()

file() = map()

message()

message() = #{commit_id => string(), path => binary(), position => pos_integer(), text => binary()}

req_data()

req_data() = map()

review()

review() = #{commit_id => string() | binary(), body => string() | binary(), event => review_event(), comments => [review_comment()]}

review_comment()

review_comment() = #{path => string() | binary(), position => pos_integer(), body => string() | binary()}

review_event()

review_event() = string() | binary()

"APPROVE" | "REQUEST_CHANGES".

webhook_target_url()

webhook_target_url() = string() | undefined

Function Index

event/3Should be called from the endpoint that handles the GitHub's request for the webhook.
event/6Should be called from the endpoint that handles the GitHub's request for the webhook.

Function Details

event/3

event(Module::atom(), Cred::egithub:credentials(), Request::egithub_webhook_req:request()) -> ok | {error, term()}

Should be called from the endpoint that handles the GitHub's request for the webhook.

event/6

event(Module::atom(), StatusCred::egithub:credentials(), ToolName::string(), Context::string(), CommentsCred::egithub:credentials(), Request::egithub_webhook_req:request()) -> ok | {error, term()}

Should be called from the endpoint that handles the GitHub's request for the webhook.

The credentials provided in the StatusCred argument need to have the appropiate permissions to be able to change the repository's status.


Generated by EDoc