create_pull_request: Create an pull request in a repository

Description Usage Arguments Details Value Examples

View source: R/pull-requests.R

Description

This function creates a new pull request for the specified repository in GitHub. It can also be used to assign the pull request to a user, request reviewers and add labels or a milestone.

Usage

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

Arguments

title

(string) The title of the pull request.

repo

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

head

(string) The name of the branch where your changes are implemented. For cross-repository pull requests, prefix head with an owner, e.g. "username:branch".

base

(string) The name of the branch you want the changes pulled into. This should be an existing branch in the specified repository.

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.

...

Parameters passed to gh_request().

Details

For more details see the GitHub API documentation:

Value

create_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
20
21
22
23
24
## Not run: 

  create_pull_request(
    title = "test pull request",
    repo  = "ChadGoymer/githapi",
    head  = "test-pulls",
    base  = "main",
    body  = "This is a pull request to test create_pull_request()"
  )

  create_pull_request(
    title     = "test assigned pull request",
    repo      = "ChadGoymer/githapi",
    head      = "test-pulls-2",
    base      = "main",
    body      = "This is a pull request to test create_pull_request()",
    assignees = "ChadGoymer",
    reviewers = c("BobSmith", "JaneJones"),
    labels    = "enhancement",
    milestone = "Release-1.0"
  )


## End(Not run)

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