Create a pull request after generating code changes.
createPullRequest
method allows you to create a GitHub pull request after code changes have been generated using any supported agent (Codex, Claude, OpenCode, or Gemini). This method streamlines the process of submitting code changes for review by automatically creating a pull request with the generated modifications.
Parameter | Type | Required | Description |
---|---|---|---|
labelOptions | LabelOptions | No | Optional label configuration for the pull request |
branchPrefix | string | No | Optional prefix for the branch name that will be created |
Property | Type | Required | Description |
---|---|---|---|
name | string | Yes | The name of the label to create/apply to the pull request |
color | string | Yes | The color of the label in hex format (without #). Examples: “0e8a16” (green), “d73a49” (red), “0366d6” (blue) |
description | string | Yes | A description of what this label represents |
Type | Description |
---|---|
Promise<PullRequestResponse> | Promise that resolves to a pull request response object |
Property | Type | Required | Description |
---|---|---|---|
id | number | Yes | The unique identifier of the pull request |
number | number | Yes | The pull request number |
state | string | Yes | The state of the pull request (e.g., “open”, “closed”) |
title | string | Yes | The title of the pull request |
body | string | Yes | The body/description of the pull request |
html_url | string | Yes | The URL to view the pull request on GitHub |
head | object | Yes | Information about the head branch of the PR |
base | object | Yes | Information about the base branch of the PR |
user | object | Yes | Information about the user who created the PR |
created_at | string | Yes | ISO timestamp when the PR was created |
updated_at | string | Yes | ISO timestamp when the PR was last updated |
merged | boolean | Yes | Whether the pull request has been merged |
mergeable | boolean | null | Yes | Whether the pull request can be merged |
merge_commit_sha | string | null | Yes | The SHA of the merge commit if merged |
branchName | string | Yes | The name of the branch created for the PR |
commitSha | string | No | The SHA of the commit |
branchPrefix
, the final branch name will be in the format {branchPrefix}/{generated-suffix}
labelOptions
parameter creates a new label if it doesn’t exist in the repository and applies it to the pull request