view_pull_requests: View pull requests within a repository

Description Usage Arguments Details Value Examples

View source: R/pull-requests.R

Description

view_pull_requests() summarises pull requests in a table with the properties as columns and a row for each pull request in the repository. view_pull_request() returns a list of all properties for a single pull request. browse_pull_request() opens the web page for the pull request in the default browser.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
view_pull_requests(
  repo,
  head,
  base,
  state = "open",
  sort = "created",
  direction = "desc",
  n_max = 1000,
  ...
)

view_pull_request(pull_request, repo, n_max = 1000, ...)

browse_pull_request(pull_request, repo, ...)

Arguments

repo

(string) The repository specified in the format: owner/repo.

head

(string, optional) Filter pull requests by the branch name. If it is not in the specified repo then the owner must prefix the branch name, e.g. "owner:branch".

base

(string, optional) Filter pull requests by the branch to be merged into.

state

(string, optional) The state of the pull requests to return. Can be either "open", "closed", or "all". Default: "open".

sort

(string, optional) The property to order the returned pull requests by. Can be either "created", "updated", "popularity" (comment count) or "long-running" (age, filtering by pulls updated in the last month). Default: "created".

direction

(string, optional) The direction of the sort. Can be either "asc" or "desc". Default: "desc".

n_max

(integer, optional) Maximum number to return. Default: 1000.

...

Parameters passed to gh_page() or gh_request().

pull_request

(string or character) The number or title of the pull request.

Details

You can filter the pull requests by the head and base branches (the branch to merge in and the branch to merge into) or the state (whether they are "open" or "closed"). You can also order the results with sort and direction.

For more details see the GitHub API documentation:

Value

view_pull_requests() returns a tibble of pull request properties. view_pull_request() returns a list of properties for a single pull request. browse_pull_request() opens the default browser on the pull request's page and returns the URL.

Pull Request Properties:

Additionally, the view_pull_request() function also returns:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
## Not run: 

  # View all open pull requests
  view_pull_requests("ChadGoymer/githapi")

  # View all closed pull requests
  view_pull_requests("ChadGoymer/githapi", state = "closed")

  # View all pull requests for the "main" branch
  view_pull_requests("ChadGoymer/githapi", base = "main")

  # View pull requests, sorted by the most recently updated
  view_pull_requests(
    repo      = "ChadGoymer/githapi",
    sort      = "updated",
    direction = "desc"
  )

  # View single pull request
  view_pull_request("test pull request", repo = "ChadGoymer/githapi")

  # Open a pull request's page in a browser
  browse_pull_request("test pull request", repo = "ChadGoymer/githapi")


## End(Not run)

ChadGoymer/githapi documentation built on Oct. 22, 2021, 10:56 a.m.