I'm reading through the API docs and cannot find anything of much use: https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pipelines/#post
To trigger a build on a branch, it's pretty simple:
# POST: /2.0/repositories/<account>/<repo>/pipelines
{
"target": {
"type": "pipeline_ref_target",
"ref_type": "branch",
"ref_name": "master"
}
}
And works as expected.
Then I attempted to trigger on tag. Docs mention:
The following reference types are supported:
branch
named_branch
bookmark
tag
So, my idea was that this should work:
# POST: /2.0/repositories/<account>/<repo>/pipelines
{
"target": {
"type": "pipeline_ref_target",
"ref_type": "tag",
"ref_name": "<tag_name>"
}
}
But this resulted in:
{
"message": "retrofit2.adapter.rxjava.HttpException: HTTP 500 Internal Server Error (command RESULT_SERVICE_POST_PIPELINE, error key='Internal Server Error')",
"arguments": {
"spanId": df56828a4b0d7195,
"parentSpanId": "0000000000000000",
"traceId": "df56828a4b0d7195"
},
"key": "Internal Server Error"
}
How do I trigger pipeline through API for a specific tag?