I want to get a number of commits in pull request that triggered my build.
I'm using this binding:
$(body.pull_request.commits) and it works properly if I've set "Comment control" to "Not required", and pushed some commits to my PR, so no /gcbrun is required.
But if I add a comment (/gcbrun) in my pull request, the build is failing with this message: $(body.pull_request.commits)]: generic::invalid_argument: failed ParseJSONPath: pull_request is not found
I've played with this issue and discovered that to get pull request payload for /gcbrun triggred builds I need to use $(pull_request.commits), not $(body.pull_request.commits).
It's seems like there is an issue with bindings, because same payload gets binded to different paths depending on how it was triggered (with or without /gcbrun).