import requests
url = "https://api.platform.ankra.app/api/v1/org/applications/{application_id}/pipeline/push-branches"
payload = { "branch": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({branch: '<string>'})
};
fetch('https://api.platform.ankra.app/api/v1/org/applications/{application_id}/pipeline/push-branches', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/api/v1/org/applications/{application_id}/pipeline/push-branches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch": "<string>"
}
'{
"application_id": "<string>",
"branch": "<string>",
"state": "opened",
"pull_request_url": "<string>",
"pull_request_number": 123
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>",
"error_code": "pipeline_not_canonical"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Add a branch to the application's pipeline
Proposes adding one branch to on.push.branches of the application’s .ankra/pipeline.yaml as a pull request, so an environment following that branch has builds to deploy. Only that list changes; every other key and comment stays. A branch the list already matches answers already_covered with no pull request, and a second request while the pull request is open answers already_open. Held to the applications.write permission and audited.
import requests
url = "https://api.platform.ankra.app/api/v1/org/applications/{application_id}/pipeline/push-branches"
payload = { "branch": "<string>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({branch: '<string>'})
};
fetch('https://api.platform.ankra.app/api/v1/org/applications/{application_id}/pipeline/push-branches', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://api.platform.ankra.app/api/v1/org/applications/{application_id}/pipeline/push-branches \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch": "<string>"
}
'{
"application_id": "<string>",
"branch": "<string>",
"state": "opened",
"pull_request_url": "<string>",
"pull_request_number": 123
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>",
"error_code": "pipeline_not_canonical"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
One branch name or glob pattern, exactly as a branch rule holds it (no refs/ prefix, no spaces, not negated).
Response
Successful Response
The pattern as it was proposed, trimmed.
opened: a pull request adding the pattern to on.push.branches was opened. already_covered: the pipeline on the default branch already runs on it, nothing was proposed. already_open: the pull request this lane opened for the pattern is still open.
opened, already_covered, already_open The pull request; null when already_covered.
The pull request's number; null when already_covered.