Open
Description
Feature Description
Over time, orphaned attachments can accumulate in Gitea. Attachments can become orphaned e.g. when a user starts creating a PR/issue/comment/release, uploads an attachment and then decided to not post it, see #16783.
In our case we have a bot which posts build results to PRs. It overwrites existing comments to avoid clutter. We do this by deleting the existing comment and creating a new one. However, the attachments of that comment are not cleaned up.
It would be nice if Gitea would either automatically delete those unreferenced attachments or to add a Maintenance Operation which checks the attachments table and removes all which have no reference.
Screenshots
No response