After merging a branch from a PR, if you delete the branch from the web interface then any webhooks configured to trigger on the "Delete" event will not be triggered. The webhook is only triggered when deleting a branch remotely (via git push origin :branch).
I reported the same issue with Gogs a few months ago and it was fixed with this commit: https://github.com/gogs/gogs/commit/1ec365de25821ac4450996edaa2c2f7792c800b6
I'm guessing the same thing will need to be applied here.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs during the next 2 weeks. Thank you for your contributions.
To confirm: Using v1.9.5 Gitea webhooks with All Events selected, deleting a repo branch by clicking on the trash-can icon from inside the Branch(es) GUI handler correctly gives a delete notification for the branch (followed by a somewhat unexpected push notification with commits=[ ] and after=all zeroes).
However, if you merge a PR (gives 3 notifications: pull_request [opened], pull_request [closed], and push) and then delete the branch from inside that PR GUI handler, NO FURTHER NOTIFICATIONS are given, or more specifically, there is no webhook notification that the branch has been deleted.
BTW, the documentation at https://docs.gitea.io/en-us/webhooks/ is very minimal -- a list of what notifications are given by what events would be very helpful. (I'm still trying to figure out what particular event sends the create notification. Tried looking through the code but quickly got lost -- I can see ActionCreateRepo, ActionCreateIssue, ActionCreatePull Request, and crudActionCreateFile in the code, but can't easily match those to which webhooks are actually called and from where, e.g., I think from what I've seen flying by in my webhook handler, create issue gives a issue webhook, not a create one?)
Just leaving a note that I'm going to try to fix this bug.
This issue can be closed, it was fixed by PR #9424 and was also backported to 1.10.0
@bhalbright thanks :)