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

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}

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})
[]

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}