Pick up a GitHub repository's new releases by themselves
curl --request PUT \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/github \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repository": "<string>",
"files": [
"<string>"
],
"unpack": true,
"tag": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({repository: '<string>', files: ['<string>'], unpack: true, tag: '<string>'})
};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/github', 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"
payload = {
"repository": "<string>",
"files": ["<string>"],
"unpack": True,
"tag": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"repository": "https://github.com/mira/lantern-run",
"files": [
"<string>"
],
"unpack": true,
"released_tag": "<string>",
"checked_at": "<string>",
"note": "<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>"
}
}Releases
Pick up a GitHub repository's new releases by themselves
Every hour Patch looks at the repository’s latest release. A new one becomes a release like the project’s newest (the same recipe, pointed at the new files) and goes to review. Send the release files you kept and the tag the newest release came from, as POST /imports/github returned them.
PUT
/
projects
/
{owner}
/
{slug}
/
github
Pick up a GitHub repository's new releases by themselves
curl --request PUT \
--url https://patch.gg/api/v1/projects/{owner}/{slug}/github \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"repository": "<string>",
"files": [
"<string>"
],
"unpack": true,
"tag": "<string>"
}
'const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({repository: '<string>', files: ['<string>'], unpack: true, tag: '<string>'})
};
fetch('https://patch.gg/api/v1/projects/{owner}/{slug}/github', 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"
payload = {
"repository": "<string>",
"files": ["<string>"],
"unpack": True,
"tag": "<string>"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text){
"repository": "https://github.com/mira/lantern-run",
"files": [
"<string>"
],
"unpack": true,
"released_tag": "<string>",
"checked_at": "<string>",
"note": "<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>"
}
}Authorizations
An API key (pch_...) or the token from pch login.
Body
application/json
Response
Following
Example:
"https://github.com/mira/lantern-run"
The release files players get, by name with the version left out ("LanternRun_v*.zip"); null takes them all.
A browser game: its release's zip is unpacked
The GitHub release the newest Patch release came from; null when it came from the default branch
What the last check found