import requests
url = "https://api.platform.ankra.app/org/applications/{application_id}/setup-pull-request/merge"
headers = {"cookie": "ankra_session="}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {cookie: 'ankra_session='}};
fetch('https://api.platform.ankra.app/org/applications/{application_id}/setup-pull-request/merge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/applications/{application_id}/setup-pull-request/merge \
--cookie ankra_session={
"outcome": "merged",
"pull_request_url": "<string>",
"head_sha": "<string>",
"merge_commit_sha": "<string>",
"merged_at": "2023-11-07T05:31:56Z"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Merge an application's setup pull request (browser session)
Merges the setup pull request Ankra opened for this application, so Go live continues without a trip to GitHub. Ankra takes it out of draft and squash-merges it pinned to its head commit, and only once Ankra built that commit and the build passed: the newest pipeline run of the commit, or, when no run judged the code (as for an organisation with no CI cluster), Ankra’s own build of every component. Nothing is merged, and the detail says why, while that build is running or after it failed, when the pull request conflicts, when the repository merges through its merge train, or when GitHub’s branch protection declines. The merge is recorded on the application at once, so pull_request_merged_at reads it without waiting for the webhook. Requires applications.write and the merge authority (an organisation administrator, the pull request’s author, or a member whose verified GitHub login can push to the repository); a service account token is refused. The browser route also requires the X-Ankra-CSRF header.
import requests
url = "https://api.platform.ankra.app/org/applications/{application_id}/setup-pull-request/merge"
headers = {"cookie": "ankra_session="}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {cookie: 'ankra_session='}};
fetch('https://api.platform.ankra.app/org/applications/{application_id}/setup-pull-request/merge', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/org/applications/{application_id}/setup-pull-request/merge \
--cookie ankra_session={
"outcome": "merged",
"pull_request_url": "<string>",
"head_sha": "<string>",
"merge_commit_sha": "<string>",
"merged_at": "2023-11-07T05:31:56Z"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Authorizations
Response
The setup pull request is merged: by this call (outcome merged) or by someone before it (outcome already_merged)
A merge of an application's setup pull request from Ankra: whether this call merged it, the commit Ankra built and merged, and the commit it landed as.