fix: add .forgejo/CODEOWNERS support (#8773)

Currently, the documentation mention that a CODEOWNERS file can be located in .forgejo for code owner PR review assignment, but this does not work. Add support for this location.

Resolves #8746

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8773
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: John Moon <john.moon@vts-i.com>
Co-committed-by: John Moon <john.moon@vts-i.com>
This commit is contained in:
John Moon 2025-08-05 17:00:35 +02:00 committed by Gusted
commit 0a444a374e
3 changed files with 159 additions and 142 deletions

View file

@ -71,7 +71,7 @@ func PullRequestCodeOwnersReview(ctx context.Context, issue *issues_model.Issue,
}
var rules []*issues_model.CodeOwnerRule
for _, file := range []string{"CODEOWNERS", "docs/CODEOWNERS", ".gitea/CODEOWNERS"} {
for _, file := range []string{"CODEOWNERS", "docs/CODEOWNERS", ".gitea/CODEOWNERS", ".forgejo/CODEOWNERS"} {
if blob, err := commit.GetBlobByPath(file); err == nil {
rc, size, err := blob.NewTruncatedReader(setting.UI.MaxDisplayFileSize)
if err == nil {