Followup https://github.com/go-gitea/gitea/pull/29856 (cherry picked from commit c20b56815d4f27ffd1b457ec238e494adc5fba81)