跳转到内容
Try Gitea Cloud ☁️ for 30 days → Accelerate your Development & Deploys!
This is the documentation of the next version, still under development. See the latest release.

Merge a pull request

POST
/repos/{owner}/{repo}/pulls/{index}/merge
curl --request POST \
--url https://gitea.com/api/v1/repos/example/example/pulls/1/merge \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "delete_branch_after_merge": true, "do": "merge", "force_merge": true, "head_commit_id": "example", "merge_commit_id": "example", "merge_message_field": "example", "merge_title_field": "example", "merge_when_checks_succeed": true }'
owner
required
string

Owner of the repo

repo
required
string

Name of the repo

index
required
integer format: int64

Index of the pull request to merge

Media typeapplication/json
MergePullRequestOption

MergePullRequestForm form for merging Pull Request

object
delete_branch_after_merge
boolean
do
required
string
Allowed values: merge rebase rebase-merge squash fast-forward-only manually-merged
force_merge
boolean
head_commit_id
string
merge_commit_id
string
merge_message_field
string
merge_title_field
string
merge_when_checks_succeed

Merge once branch protection requirements like required status checks and approvals are met. Other checks are not awaited.

boolean

APIEmpty is an empty response

APIEmpty is an empty response

APIError is error format response

Media typeapplication/json
APIError

Is an api error with a message

object
message

Message contains the error description

string
url

URL contains the documentation URL for this error

string format: uri

Example generated

{
"message": "example",
"url": "https://example.com"
}