import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-build-branch"
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://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-build-branch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-build-branch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch": "<string>"
}
'{
"outcome": "started",
"message": "<string>",
"branch": "<string>",
"pull_request_url": "<string>",
"added_to": [
"push"
]
}{
"outcome": "started",
"message": "<string>",
"branch": "<string>",
"pull_request_url": "<string>",
"added_to": [
"push"
]
}{
"outcome": "started",
"message": "<string>",
"branch": "<string>",
"pull_request_url": "<string>",
"added_to": [
"push"
]
}{
"outcome": "started",
"message": "<string>",
"branch": "<string>",
"pull_request_url": "<string>",
"added_to": [
"push"
]
}Build a branch in an application's pipeline
Adds one branch to the on.push.branches of the application’s .ankra/pipeline.yaml, and to on.pull_request.branches when that block filters branches, and opens a pull request proposing it, so an environment that follows that branch gets builds and pull requests into it get runs and previews once the pull request merges. A list that already covers the branch is left alone, and a pull_request block is never added. Each list is edited where the parser located it; the rest of the file, comments included, is left as it was. A second call while the pull request is open answers already_open with its URL and commits nothing. Requires applications.write.
import requests
url = "https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-build-branch"
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://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-build-branch', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));curl --request POST \
--url https://platform.ankra.app/api/v1/org/applications/{application_id}/pipeline-build-branch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch": "<string>"
}
'{
"outcome": "started",
"message": "<string>",
"branch": "<string>",
"pull_request_url": "<string>",
"added_to": [
"push"
]
}{
"outcome": "started",
"message": "<string>",
"branch": "<string>",
"pull_request_url": "<string>",
"added_to": [
"push"
]
}{
"outcome": "started",
"message": "<string>",
"branch": "<string>",
"pull_request_url": "<string>",
"added_to": [
"push"
]
}{
"outcome": "started",
"message": "<string>",
"branch": "<string>",
"pull_request_url": "<string>",
"added_to": [
"push"
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
The one branch to build: a literal Git branch name, not a pattern.
200Response
A pull request adding the branch was opened (started), or one is already open (already_open)
started, already_open, already_builds, application_not_found, not_on_ankra_pipeline, no_pipeline_file, no_push_trigger, not_editable, invalid_branch, credential_unavailable, commit_failed The triggers whose branch lists the opened pull request widens.
push, pull_request