Custodian v0.0.1 Custodian.Github View Source
The GitHub context provides a boundary into the GitHub API client interface and associated domain logic. The top-level class provides a way to process webhook payloads from GitHub.
Link to this section Summary
Types
Pull request identifier as a tuple with the repo and integer ID
Functions
Calls the processing function appropriate for the type
and params
Link to this section Types
Pull request identifier as a tuple with the repo and integer ID.
Link to this section Functions
Link to this function
process_event(type, params)
View Source
process_event(String.t(), map()) :: :ok | {:error, atom()}
Calls the processing function appropriate for the type
and params
.
Events
Currently, the app responds to the following GitHub webhook events:
installation
: whenever repos are installed or uninstalledinstallation_repositories
: whenever repos are added to the installationpull_request
: whenever a pull request is opened or updatedpull_request_review
: whenever a pull request review is submitted
For any other event, it fails.
Examples
iex> process_event("installation", %{})
{:ok, [%Bot]}
iex> process_event("pull_request", %{})
{:ok, [%Bot]}