Description Usage Arguments Details Value Examples
View source: R/pull-requests.R
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.
1 2 3 4 5 6 7 8 9 10 11 12 |
title |
(string) The title of the pull request. |
repo |
(string) The repository specified in the format: |
head |
(string) The name of the branch where your changes are
implemented. For cross-repository pull requests, prefix |
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 |
For more details see the GitHub API documentation:
https://docs.github.com/en/rest/reference/pulls#create-a-pull-request
https://docs.github.com/en/rest/reference/issues#update-an-issue
https://docs.github.com/en/rest/reference/pulls#request-reviewers-for-a-pull-request
create_pull_request()
returns a list of the pull request's
properties.
Pull Request Properties:
number: The number assigned to the pull request.
title: The title of the pull request.
body: The body contents of the pull request.
head_sha: The SHA of the commit to merge in.
head_ref: The reference, or branch, to merge in.
head_repo: The repository containing the branch to merge in.
base_sha: The SHA of the commit to merge onto.
base_ref: The reference, or branch, to merge onto.
merge_sha: The SHA of the merge commit, if the merge has been completed.
assignees: The users assigned to the pull request.
reviewers: The users reviewing the pull request.
labels: The labels attached to the pull request.
milestone: The milestone assigned to the pull request.
state: The state of the pull request - either "open"
or "closed"
.
repository: The repository the pull request is in.
html_url: The URL of the pull request's web page in GitHub.
diff_url: The URL of the pull request's diff web page in GitHub.
creator: The creator's login.
created_at: When the pull request was created.
updated_at: When the pull request was last updated.
mergeable: Whether the pull request can be merged.
rebaseable: Whether the pull request can be rebased.
merged: Whether the pull request has been merged
merged_by: Who merged the pull request.
merged_at: When the pull request was merged.
closed_at: When the pull request was closed.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.