Greetings,
I can't send variables to my Pipeline using the API. The Pipeline is successfully triggered but the variables do not show up...here's my cURL:
curl -X POST --url 'https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/pipelines' --header 'Authorization: Bearer <token>' --header 'Content-Type: application/json' -d '{"target":{"type":"pipeline_ref_target","ref_type":"branch","ref_name":"main","variables":[{"key":"MY_VAR","value":"test","secured":false}]}}'
Appreciate any help.
Found the problem, the body of my POST was wrong, here's the correct version:
curl -X POST --url 'https://api.bitbucket.org/2.0/repositories/<workspace>/<repository>/pipelines' --header 'Authorization: Bearer <token>' --header 'Content-Type: application/json' -d '{"target":{"type":"pipeline_ref_target","ref_type":"branch","ref_name":"main"},"variables":[{"key":"MY_VAR","value":"test"}]}'
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.