Previously, I was able to trigger a pipeline on a particular branch using the Circleci V1.1 API.
curl -s -u ${token}: https://circleci.com/api/v1.1/project/github/org/job-name/tree/$branch
which was successfully able to Trigger a pipeline.
I want to upgrade to circleci 2.1and so the above will no longer work.
I am trying:
curl -f -u ${token}: -X POST --header “Content-Type: application/json” -d ‘{“parameters”: {“branch”: “$branch”}}’ https://circleci.com/api/v2/project/gh/org/job-name/pipeline
However, this is always triggered on the master branch, rather than the branch that I specify in the param.
Any advice?