Make a new GitHub Pull Request with a set of changes applied on top of primary branch HEAD. The changes are committed into a new branch based on the upstream repository options using the authenticated Octokit account. Then a Pull Request is made from that branch.
Also throws error if git data from the fork is not ready in 5 minutes.
From the docs https://developer.github.com/v3/repos/forks/#create-a-fork """ Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact GitHub Support or GitHub Premium Support. """
If changes are empty then the workflow will not run. Rethrows an HttpError if Octokit GitHub API returns an error. HttpError Octokit access_token and client_secret headers redact all sensitive information.
Parameters
Name
Description
octokit
Octokit
The authenticated octokit instance, instantiated with an access token having permissiong to create a fork on the target repository
Get the git changes of the current project asynchronously. Rejects if any of the files fails to load (if not deleted), or if there is a git diff parse error
Convert a Map<string,string> or {[path: string]: string}, where the key is the relative file path in the repository, and the value is the text content. The files will be converted to a Map also containing the file mode information '100644'
Given a set of suggestions, make all the multiline inline review comments on a given pull request given that they are in scope of the pull request. Outof scope suggestions are not made.
In-scope suggestions are specifically: the suggestion for a file must correspond to a file in the remote pull request and the diff hunk computed for a file's contents must produce a range that is a subset of the pull request's files hunks.
If a file is too large to load in the review, it is skipped in the suggestion phase.
If changes are empty then the workflow will not run. Rethrows an HttpError if Octokit GitHub API returns an error. HttpError Octokit access_token and client_secret headers redact all sensitive information.
Parameters
Name
Description
octokit
Octokit
The authenticated octokit instance, instantiated with an access token having permissiong to create a fork on the target repository.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Package code-suggester (5.0.0)\n\nVersion latestkeyboard_arrow_down\n\n- [5.0.0 (latest)](/nodejs/docs/reference/code-suggester/latest/overview)\n- [4.3.3](/nodejs/docs/reference/code-suggester/4.3.3/overview)\n- [4.1.1](/nodejs/docs/reference/code-suggester/4.1.1/overview)\n- [4.0.1](/nodejs/docs/reference/code-suggester/4.0.1/overview)\n- [2.2.0](/nodejs/docs/reference/code-suggester/2.2.0/overview)\n- [2.1.4](/nodejs/docs/reference/code-suggester/2.1.4/overview) \n\nClasses\n-------\n\n### [CommitError](/nodejs/docs/reference/code-suggester/latest/code-suggester/commiterror)\n\nInterfaces\n----------\n\n### [CommitData](/nodejs/docs/reference/code-suggester/latest/code-suggester/commitdata)\n\n### [CommitSigner](/nodejs/docs/reference/code-suggester/latest/code-suggester/commitsigner)\n\n### [CreatePullRequestUserOptions](/nodejs/docs/reference/code-suggester/latest/code-suggester/createpullrequestuseroptions)\n\nThe user options for creating GitHub PRs\n\n### [CreateReviewCommentUserOptions](/nodejs/docs/reference/code-suggester/latest/code-suggester/createreviewcommentuseroptions)\n\nThe user options for creating GitHub PR review comment\n\nFunctions\n---------\n\n### createPullRequest(octokit, changes, options)\n\n declare function createPullRequest(octokit: Octokit, changes: Changes | null | undefined, options: CreatePullRequestUserOptions): Promise\n\nMake a new GitHub Pull Request with a set of changes applied on top of primary branch HEAD. The changes are committed into a new branch based on the upstream repository options using the authenticated Octokit account. Then a Pull Request is made from that branch.\n\nAlso throws error if git data from the fork is not ready in 5 minutes.\n\nFrom the docs https://developer.github.com/v3/repos/forks/#create-a-fork \"\"\" Forking a Repository happens asynchronously. You may have to wait a short period of time before you can access the git objects. If this takes longer than 5 minutes, be sure to contact GitHub Support or GitHub Premium Support. \"\"\"\n\nIf changes are empty then the workflow will not run. Rethrows an HttpError if Octokit GitHub API returns an error. HttpError Octokit access_token and client_secret headers redact all sensitive information. \n\n### getChanges(dir)\n\n export declare function getChanges(dir: string): Promise\n\nLoad the change set asynchronously. \n\n### getDiffString(dir)\n\n export declare function getDiffString(dir: string): string;\n\nGet the git changes of the current project asynchronously. Rejects if any of the files fails to load (if not deleted), or if there is a git diff parse error \n\n### parseTextFiles(textFiles)\n\n declare function parseTextFiles(textFiles: {\n [path: string]: string | null;\n } | Map\n\nConvert a Map\\\u003cstring,string\\\u003e or {\\[path: string\\]: string}, where the key is the relative file path in the repository, and the value is the text content. The files will be converted to a Map also containing the file mode information '100644' \n\n### reviewPullRequest(octokit, diffContents, options)\n\n export declare function reviewPullRequest(octokit: Octokit, diffContents: Map\n\nGiven a set of suggestions, make all the multiline inline review comments on a given pull request given that they are in scope of the pull request. Outof scope suggestions are not made.\n\nIn-scope suggestions are specifically: the suggestion for a file must correspond to a file in the remote pull request and the diff hunk computed for a file's contents must produce a range that is a subset of the pull request's files hunks.\n\nIf a file is too large to load in the review, it is skipped in the suggestion phase.\n\nIf changes are empty then the workflow will not run. Rethrows an HttpError if Octokit GitHub API returns an error. HttpError Octokit access_token and client_secret headers redact all sensitive information. \n\nType Aliases\n------------\n\n### Changes\n\n export type Changes = Map\n\nThe map of a path to its content data. The content must be the entire file content."]]