forked from gitea/gitea

Backport #24238 by @wxiaoguang Close #24237 Before: <details>  </details> After:  Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>