From 85f31eb643f6beb67cc2e32a1ce8dd5512f079e1 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Sun, 17 Mar 2024 09:40:06 +0800 Subject: Fix codeowner detected diff base branch to mergebase (#29783) (#29807) Fix #29763 Backport #29783 This PR fixes 2 problems with CodeOwner in the pull request. - Don't use the pull request base branch but merge-base as a diff base to detect the code owner. - CodeOwner detection in fork repositories will be disabled because almost all the fork repositories will not change CODEOWNERS files but it should not be used on fork repositories' pull requests. --------- Co-authored-by: wxiaoguang --- templates/shared/issueicon.tmpl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'templates') diff --git a/templates/shared/issueicon.tmpl b/templates/shared/issueicon.tmpl index 2a2e70085a..b8c03c6cb6 100644 --- a/templates/shared/issueicon.tmpl +++ b/templates/shared/issueicon.tmpl @@ -7,9 +7,9 @@ {{if .IsClosed}} {{svg "octicon-git-pull-request" 16 "text red"}} {{else}} - {{if and .PullRequest .PullRequest.IsWorkInProgress}} + {{if and .PullRequest .PullRequest.IsWorkInProgress ctx}} {{svg "octicon-git-pull-request-draft" 16 "text grey"}} - {{else if and .GetPullRequest .GetPullRequest.IsWorkInProgress}} + {{else if and .GetPullRequest .GetPullRequest.IsWorkInProgress ctx}} {{svg "octicon-git-pull-request-draft" 16 "text grey"}} {{else}} {{svg "octicon-git-pull-request" 16 "text green"}} -- cgit v1.2.3