diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2025-03-13 19:36:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-13 19:36:14 -0700 |
commit | 1e7248047ce66c235faf53cd79b6513fb3aa1c50 (patch) | |
tree | a97bbdf8edc017be7e4365b36396da06442538c5 /routers/web/repo | |
parent | de2d472d90b1c563a432e27621cb455378b700f8 (diff) | |
download | gitea-1e7248047ce66c235faf53cd79b6513fb3aa1c50.tar.gz gitea-1e7248047ce66c235faf53cd79b6513fb3aa1c50.zip |
Pull request updates will also trigger code owners review requests (#33744)
Fix #33490
It will only read the changed file on the pushed commits but not all the
files of this PR.
---------
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'routers/web/repo')
-rw-r--r-- | routers/web/repo/view_file.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/routers/web/repo/view_file.go b/routers/web/repo/view_file.go index 5784297918..4ce7a8e3a4 100644 --- a/routers/web/repo/view_file.go +++ b/routers/web/repo/view_file.go @@ -9,7 +9,6 @@ import ( "image" "io" "path" - "slices" "strings" git_model "code.gitea.io/gitea/models/git" @@ -79,7 +78,7 @@ func prepareToRenderFile(ctx *context.Context, entry *git.TreeEntry) { if workFlowErr != nil { ctx.Data["FileError"] = ctx.Locale.Tr("actions.runs.invalid_workflow_helper", workFlowErr.Error()) } - } else if slices.Contains([]string{"CODEOWNERS", "docs/CODEOWNERS", ".gitea/CODEOWNERS"}, ctx.Repo.TreePath) { + } else if issue_service.IsCodeOwnerFile(ctx.Repo.TreePath) { if data, err := blob.GetBlobContent(setting.UI.MaxDisplayFileSize); err == nil { _, warnings := issue_model.GetCodeOwnersFromContent(ctx, data) if len(warnings) > 0 { |