curl --request POST \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/change-requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch": "port-26.5",
"title": "<string>",
"from": "kai/sky-mod",
"into": "main",
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branch: 'port-26.5',
title: '<string>',
from: 'kai/sky-mod',
into: 'main',
description: '<string>'
})
};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/change-requests', 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"
payload = {
"branch": "port-26.5",
"title": "<string>",
"from": "kai/sky-mod",
"into": "main",
"description": "<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>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}Offer a branch to this repo
Opens a change request from branch of from into into, this repo’s default branch unless you say. from is a fork of this repo, or a fork of one of its forks, and you’re in its org. The branch’s commits are first copied into this repo, on a hidden branch a clone doesn’t see, and read as they’re copied. git fetch <clone_url> <head_commit> gets them while it’s open. Only open repos take change requests from forks, unless their owner turned them off. The fork has to be open too, since its commits become readable here.
The repo’s own org can offer one of its branches into another, so a change is looked at before it lands: leave from out, or name this repo. That works whatever the repo’s visibility, and whether or not it takes change requests from forks, since its commits are already in it. The branch has to be there and not be into (422 same_branch). Anyone in the org can merge it, whoever opened it withdraws it, and the rest of the org declines it.
A repo whose home is GitHub takes none: its changes are pull requests on GitHub (403 change_requests_off, with that page in details.pull_requests). Needs the publish scope.
curl --request POST \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/change-requests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch": "port-26.5",
"title": "<string>",
"from": "kai/sky-mod",
"into": "main",
"description": "<string>"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
branch: 'port-26.5',
title: '<string>',
from: 'kai/sky-mod',
into: 'main',
description: '<string>'
})
};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/change-requests', 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"
payload = {
"branch": "port-26.5",
"title": "<string>",
"from": "kai/sky-mod",
"into": "main",
"description": "<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>"
}
}{
"error": {
"code": "version_exists",
"message": "<string>",
"details": "<unknown>"
}
}Authorizations
An API key (pch_...) or the token from pch login.
Body
The branch it offers, in from
^(?![-/])(?!.*\.\.)[\w.\-/]{1,200}$"port-26.5"
1 - 200The fork, as owner/slug. Leave it out, or name this repo, to offer one of this repo's own branches, as its org.
^[^/\s]+\/[^/\s]+$"kai/sky-mod"
The branch it would change here; the default branch unless you say
^(?![-/])(?!.*\.\.)[\w.\-/]{1,200}$"main"
20000Response
Opened
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.