Convenience functions for the GitHub Pull Requests REST API.
Each function is a thin wrapper over GhEx.REST that fills in the endpoint
path. They return the same {:ok, body, meta} / {:error, reason} shape as
GhEx.REST and pass opts through to Req, so :params, headers, and a
Req.Test plug all work. For an endpoint without a wrapper, call GhEx.REST
directly.
Summary
Functions
Creates a pull request. attrs is the JSON body (title, head, base, body, draft, ...).
Creates a review on a pull request. attrs sets event (APPROVE, REQUEST_CHANGES, COMMENT), body, comments.
Gets a single pull request by number.
Lists pull requests in a repository. Use params: for state, base, head,
and the other query options.
Lists the files changed in a pull request.
Lists the reviews on a pull request.
Merges a pull request. attrs may set commit_title, commit_message, and
merge_method ("merge", "squash", or "rebase").
Updates a pull request. attrs may set title, body, state, base, and so on.
Types
Functions
@spec create(GhEx.Client.t(), String.t(), String.t(), map(), keyword()) :: GhEx.REST.result()
Creates a pull request. attrs is the JSON body (title, head, base, body, draft, ...).
@spec create_review( GhEx.Client.t(), String.t(), String.t(), number_ref(), map(), keyword() ) :: GhEx.REST.result()
Creates a review on a pull request. attrs sets event (APPROVE, REQUEST_CHANGES, COMMENT), body, comments.
@spec get(GhEx.Client.t(), String.t(), String.t(), number_ref(), keyword()) :: GhEx.REST.result()
Gets a single pull request by number.
@spec list(GhEx.Client.t(), String.t(), String.t(), keyword()) :: GhEx.REST.result()
Lists pull requests in a repository. Use params: for state, base, head,
and the other query options.
@spec list_files(GhEx.Client.t(), String.t(), String.t(), number_ref(), keyword()) :: GhEx.REST.result()
Lists the files changed in a pull request.
@spec list_reviews(GhEx.Client.t(), String.t(), String.t(), number_ref(), keyword()) :: GhEx.REST.result()
Lists the reviews on a pull request.
@spec merge(GhEx.Client.t(), String.t(), String.t(), number_ref(), map(), keyword()) :: GhEx.REST.result()
Merges a pull request. attrs may set commit_title, commit_message, and
merge_method ("merge", "squash", or "rebase").
@spec update(GhEx.Client.t(), String.t(), String.t(), number_ref(), map(), keyword()) :: GhEx.REST.result()
Updates a pull request. attrs may set title, body, state, base, and so on.