Open a pull request
forgejo_create_pull_requestCreate a pull request between two branches in a Forgejo repository. Specify source branch, target branch, and title to propose merging changes already pushed to the server.
Instructions
Opens a pull request between two branches of the repository. Write operation: requires the 'write:repository' scope.
Parameters:
owner, repo (optional when defaults are configured)
head (string, required): source branch, already pushed to the server
base (string, required): target branch, typically 'main'
title (string, required)
body (string, optional)
Returns: { number, title, state, head, base, html_url }
Prerequisite: the 'head' branch must exist server-side — push before calling. Errors: 409 if a PR is already open for this branch pair; 404 if the head or base branch does not exist; 422 if the request is otherwise rejected.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| base | Yes | Target branch, for example 'main'. | |
| body | No | Markdown description. | |
| head | Yes | Source branch, pushed to the server. | |
| repo | No | Repository name. Defaults to FORGEJO_DEFAULT_REPO. | |
| owner | No | Repository owner (user or organisation). Defaults to FORGEJO_DEFAULT_OWNER. | |
| title | Yes | Pull request title. | |
| response_format | No | 'markdown' for a readable rendering, 'json' for the full data. | markdown |