Custodian v0.0.1 Custodian.Github.Tentacat.Labels View Source
Provides an implementation of the Custodian.Github.Labels
behaviour with
the GitHub API.
This module contains convenience methods for listing, adding, and removing labels from GitHub pull requests via the GitHub v3 API over HTTPS.
Link to this section Summary
Functions
Adds the provided label(s) to the given pull request. Checks if labels are present before trying to add. This avoids creating duplicate events on the pull request timeline. [More info]
Returns a list of all of the labels on a given pull request. [More info]
Removes a given label from a given pull request. Checks if label is present before removing to avoid API errors. [More info]
Link to this section Functions
add(Custodian.Github.pull_request(), [String.t()] | String.t()) :: Custodian.Github.pull_request()
Adds the provided label(s) to the given pull request. Checks if labels are present before trying to add. This avoids creating duplicate events on the pull request timeline. More info.
Examples
iex> add({%Bot{}, 1}, "needs-review")
{%Bot{}, 1}
iex> add({%Bot{}, 1}, ["needs-review", "in-progress"])
{%Bot{}, 1}
all(Custodian.Github.pull_request()) :: [String.t()]
Returns a list of all of the labels on a given pull request. More info.
Examples
iex> all({%Bot{}, 1})
["needs-review"]
iex> all({%Bot{}, 1})
[]
remove(Custodian.Github.pull_request(), String.t()) :: Custodian.Github.pull_request()
Removes a given label from a given pull request. Checks if label is present before removing to avoid API errors. More info.
Examples
iex> remove({%Bot{}, 1}, "needs-review")
{%Bot{}, 1}
iex> remove({%Bot{}, 1}, "in-progress")
{%Bot{}, 1}