Webhooks: Setting a branch for push evens fail

Hi,
I am setting up a webhook to trigger on push events on a branch called datahike-env. But when I test the trigger a post with the incorrect branch is sent out.

https://gitlab.com/team-batfish/backend/jobtech-taxonomy-api/hooks/5637634/edit
https://gitlab.com/team-batfish/backend/jobtech-taxonomy-api/hooks/5637634/hook_logs/768673909

{
“object_kind”: “push”,
“event_name”: “push”,
“before”: “28a70cfdf241a807dd04f1e4a9b50c6142b5fb98”,
“after”: “57a5b14064121281d0d81a185d168da6b8d254b0”,
“ref”: “refs/heads/develop”,
“checkout_sha”: “57a5b14064121281d0d81a185d168da6b8d254b0”,
“message”: null,

The Test feature of Webhooks will use a sample commit from your project to send out a test event. This will sample the default branch and not follow the push event branch filter rules.

Your actual Webhook push events (non-test) will follow the rules as configured. Are you seeing actual events also carrying the incorrect branch? If yes, can you clarify what your configuration for the branch filter is?

Oh thanks for the answer! I haven’t tested that yet. I am setting up a gitops pipeline for a new branch and it would really have been helpful if the test push event emulated a real event, that is sending the last commit on the branch selected. I will push a real commit right away and see what happens.

It works when pushing real commits. But I gotta say that it would be a bit more convenient to be able to use the test button, instead of pushing dummy commits to a repo, when developing a CI/CD pipeline.