I have installed a webhook via the API and have received an event. I was unable to find a proper specification (e.g. a data schema) of the values to be expected but the payload seems to contain all of the information of the example payload at: Webhooks | SonarCloud
In addition to the properties of the example, the payload also contains a property called “branch”:
Unfortunately, the branch’s name is wrong. It seems to be a stringified version of the pull request’s number but I’m not sure. In any case, there is no branch whose name is “20” in my repository, so I want to report this bug.
It would be really nice to actually get the branch’s name so I don’t need to integrate with github in order to figure out the name of the branch based on the stringified version of the PR’s number, all while hoping that this undocumented behavior of the webhook will continue.
Ah, I didn’t know that there was a difference. Thank you very much. It was a PR analysis. I would’ve liked to get the name of the branch used in the PR.
However, I have now changed the “Long-lived branches pattern” to .* and have pushed a commit to a new branch and created a PR. I have also pushed a new branch and then pushed a new commit to it w/o creating a PR. None of these activities have resulted in me receiving an event payload about a branch analysis. I have only received an event that contains "type":"PULL_REQUEST" with the name again being the stringified version of the PR number on github. I think there still is something I’m missing. But I also think that describing the PR number as a branch name is wrong.
EDIT: I have checked https://sonarcloud.io/project/branches_list?id=[my project's key]. It still shows the “Long-lived branches pattern” to be .* but it does not show any branches other than “main”.