Description
Description
When you set up a discord-type webhook where you chose your events and selected Release
will Gitea not send a Webhook when you save a new release as draft. This is fine and something I would expect as you may not want to publish new info too early to everyone.
However, if you edit said draft and again save it as such, therefore editing the draft, will Gitea send a webhook with the edit notification, which isn't really an optimal thing to do here.
Note that I have encountered this behaviour on a forgejo instance and I cannot test it within try.gitea.io due to it not allowing to make release drafts... So testing it yourself if you have the permission - or granting me the permission (Username is Andre601) to make drafts - is recommended.
Steps for possible reproduction:
- Create a Discord Webhook and copy URL
- Create a new Webhook on your Repository by selecting "Discord" as the webhook type
- Paste the URL into the URL field
- Select "Custom Events" followed by "Release"
- Go to releases tab
- Draft a new release and save it as a draft
- Edit the draft and save it as draft again
- Notice the webhook sending despite the edited release still being a draft
I would like to take the oportunity to also propose changes to the webhook system.
The way it is right now is flexible, yet rigit.
Flexible, because you can define your own selection of events to send a webhook for, but rigit because the selectable events group common types together, without any way of filtering them out...
As an example "Release" includes creation, deletion and edits of releases, without having any option to only have creation and edits f.e.
It should be considered to allow more fine-grained selections. Maybe by having the types as sub-lists of the event itself to select, where selecting the main/parent event would auto-select all the sub-list items...
A quick mockup using GitHub checkbox lists:
- Release
- Create
- Edit
- Delete
I can create a separate issue for this as a feature request if that is wanted.
Gitea Version
1.20.3+0-38-g0e33ecb13
Can you reproduce the bug on the Gitea demo site?
No (Not possible to test on that instance)
Log Gist
No response
Screenshots
Webhook message of the edited release draft:
The release in question, clearly marked as Draft:
Git Version
Operating System
How are you running Gitea?
I do not self-host/run it, but use codeberg.org for this.
As mentioned is the instance actually using forgejo, but given its soft-fork nature and currently not having any major differences from Gitea, I have strong beliefs that this bug exists within Gitea itself.
Database
None