update_pull_request: Update a pull request in a repository

Description Usage Arguments Details Value Examples

View source: R/pull-requests.R

Description

This function updates a pull request for the specified repository in GitHub. It can be used to change the title or body, or used to close the pull request. It can also be used to assign the pull request to a user, request reviewers and replace labels or a milestone.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
update_pull_request(
  pull_request,
  repo,
  title,
  body,
  assignees,
  reviewers,
  labels,
  milestone,
  base,
  state,
  ...
)

Arguments

pull_request

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

repo

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

title

(string, optional) The new title of the pull request.

body

(string, optional) The contents of the pull request.

assignees

(character, optional) Logins for Users to assign to this pull request. NOTE: Only users with push access can set assignees for new pull requests.

reviewers

(character, optional) Logins for Users to review this pull request. NOTE: Only users with push access can set reviewers for new pull requests.

labels

(character, optional) Labels to associate with this pull request. NOTE: Only users with push access can set labels for new pull requests.

milestone

(character or integer, optional) The title or number of the milestone to associate this pull request with. NOTE: Only users with push access can set the milestone for new pull requests.

base

(string, optional) The name of the branch you want the changes pulled into. This should be an existing branch on the current repository.

state

(string, optional) The state of the pull request. Either "open" or "closed".

...

Parameters passed to gh_request().

Details

For more details see the GitHub API documentation:

Value

update_pull_request() returns a list of the pull request's properties.

Pull Request Properties:

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 

  # Update a pull request's properties
  update_pull_request(
    pull_request = "test pull request",
    repo         = "ChadGoymer/githapi",
    title        = "test updated pull request",
    body         = "This is an updated pull request"
  )

  # Close a pull request
  update_pull_request(
    pull_request = "test updated pull request",
    repo         = "ChadGoymer/githapi",
    state        = "closed"
  )


## End(Not run)

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