I'm trying to set up JSONPath filtering on incoming Bitbucket webhooks so the pipeline will only start when a push is made to the branch the pipeline is watching. The relevant parts of the webhook request body are:
{
"push": {
"changes": [
{
"new": {
"name": "repo_name"
}
}
]
}
}
which I filter with $.push.changes[0].new.name
and check to see if the filter result matches {Branch}
. I've also tried explicitly setting the branch name rather than letting CodePipeline resolve it.
I've confirmed this correctly filters the request with jsonpath.com, but using this no executions are triggered. I am able to get executions to trigger by using a JSONPath that just matches the repository name, but this is not ideal as executions will start when pushes are made to other branches too. What am I doing wrong?