curl --request POST \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/change-requests/{number}/merge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"squash": false,
"message": "<string>",
"head": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({squash: false, message: '<string>', head: '<string>'})
};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/change-requests/{number}/merge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://patch.gg/api/v1/projects/{owner}/{slug}/change-requests/{number}/merge"
payload = {
"squash": False,
"message": "<string>",
"head": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"number": 12,
"title": "Port to 26.5",
"description": "<string>",
"state": "open",
"from": "kai/sky-mod",
"branch": "port-26.5",
"into": "26.5",
"head_commit": "<string>",
"problems": [
"<string>"
],
"author": "kai",
"talk_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"closed_at": "2023-11-07T05:31:56Z",
"closed_by": "<string>",
"merge_commit": "<string>"
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}Merge a change request
The repo’s org. The request has to be up to date with the branch it’s for: then merging moves that branch to the request’s latest commit, or with squash adds one commit with its files and its author, dated now, whose message is message (the title and description unless you say). When the branch has moved on, its author updates their branch first. head is the commit you looked at, so that what you merge is what you read. Needs the publish scope.
curl --request POST \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/change-requests/{number}/merge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"squash": false,
"message": "<string>",
"head": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({squash: false, message: '<string>', head: '<string>'})
};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/change-requests/{number}/merge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://patch.gg/api/v1/projects/{owner}/{slug}/change-requests/{number}/merge"
payload = {
"squash": False,
"message": "<string>",
"head": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"number": 12,
"title": "Port to 26.5",
"description": "<string>",
"state": "open",
"from": "kai/sky-mod",
"branch": "port-26.5",
"into": "26.5",
"head_commit": "<string>",
"problems": [
"<string>"
],
"author": "kai",
"talk_count": 123,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"closed_at": "2023-11-07T05:31:56Z",
"closed_by": "<string>",
"merge_commit": "<string>"
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
An API key (pch_...) or the token from pch login.
Path Parameters
"patch"
"demo-mod"
x >= 112
Body
Response
Merged
12
"Port to 26.5"
open: waiting on the repo's owner. merged: its commits are in the branch it was for. declined: the owner turned it down. withdrawn: its author took it back.
open, merged, declined, withdrawn The repo its branch is in, as owner/slug: the fork it comes from, or this repo itself for one of its own branches. Null if you can't reach the fork.
"kai/sky-mod"
The branch it offers, in from
"port-26.5"
The branch it would change in this repo
"26.5"
Its latest commit, as copied into this repo, where a clone doesn't see it: git fetch <clone_url> <head_commit> gets its commits while it's open.
What stopped the latest push to its branch being copied, which stays out of the request until it's fixed: a refusal, a fork that isn't open, which copies when it opens, or a copy that failed, which a new push tries again. Empty says nothing has stopped one, and a copy may still be on its way.
Who opened it: their username
"kai"
Posts in its talk
Who merged, declined or withdrew it: their username
The commit its branch was at after the merge.