Hi All,
I'm trying to trigger a custom pipeline for a particular branch using the following API call below:
curl -X POST -is -u <user>:<password> \
-H 'Content-Type: application/json' \
https://api.bitbucket.org/2.0/repositories/<account>/<repo>/pipelines/ \
-d ' { "target": { "ref_type": "branch", "type": "pipeline_ref_target", "ref_name": "<branch_name>" } }'
My yaml file has two paths, one is custom and the other is branch name based. The branch name based path works without issue however I'm unable to trigger the custom pipeline path without having to go the UI and doing it manually there ( I have a few repos so I don't want to constantly go back to the UI through each repo to trigger the custom path, rather script it up in a loop to fire them all off)
It ends up giving this response after posting
"Bad request", "detail": "bitbucket-pipelines.yml not found."
If I check the branch <branch_name> for that repo I can see that the bitbucket-pipelines.yml file is definitely there. Am I missing something obvious here? It makes me think the API is hitting some other branch where the file does not exist, but all branches in that repo has a bitbucket-pipelines.yml file.