Merge a pull request on a connected repo
curl --request PUT \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/github/pulls/{number}/merge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/github/pulls/{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}/github/pulls/{number}/merge"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"number": 123,
"url": "<string>",
"state": "merged",
"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>"
}
}GitHub
Merge a pull request on a connected repo
Only when the person says so. GitHub applies the repo’s protections and settings as it would for them: what it won’t do is 409 not_mergeable, in its words, such as a review still needed or a merge method the repo doesn’t allow. For a member of the project’s org who can push to its GitHub repo, as they are on GitHub. 403 github_not_linked without a connected GitHub account, github_no_push without push on the repo, and github_no_access when Patch’s GitHub App can’t reach it, or hasn’t got what this needs, with where to accept that in details.settings_url; 404 gone_from_github.
PUT
/
projects
/
{owner}
/
{slug}
/
github
/
pulls
/
{number}
/
merge
Merge a pull request on a connected repo
curl --request PUT \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/github/pulls/{number}/merge \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{}'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({})
};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/github/pulls/{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}/github/pulls/{number}/merge"
payload = {}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"number": 123,
"url": "<string>",
"state": "merged",
"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>"
}
}Authorizations
An API key (pch_...) or the token from pch login.
Path Parameters
Example:
"patch"
Example:
"demo-mod"
Example:
12
Body
application/json
How it merges: GitHub's default for the repo, left out
Available options:
merge, squash, rebase