fix: always display the pull request merge box if there are actions pending approvals

For the same reason the merge box is displayed when the user can
delete the branch from which the pull request was proposed, the trust
panel must be displayed when runs are waiting approval, either for
information or to approve/deny runs from untrusted users.

Closes forgejo/forgejo#12576
This commit is contained in:
limiting-factor 2026-05-28 11:50:15 +02:00
parent d25f7ae70d
commit 699cc47485
No known key found for this signature in database
GPG key ID: FBFC3FECD17D904F
2 changed files with 5 additions and 3 deletions

View file

@ -4,9 +4,7 @@
{{$manualMergeStyleAllowed := $prConfig.AllowManualMerge}}
{{$hasUnsignedMergeStyle := or $fastForwardStyleAllowed $manualMergeStyleAllowed}}
{{$signingBlocksAllMergeStyles := and .AllowMerge .RequireSigned (not .WillSign) (not $hasUnsignedMergeStyle)}}
{{if and .Issue.PullRequest.HasMerged (not .IsPullBranchDeletable)}}
{{/* Then the merge box will not be displayed because this page already contains enough information */}}
{{else}}
{{if or (not .Issue.PullRequest.HasMerged) .IsPullBranchDeletable .SomePullRequestRunsNeedApproval}}
<div class="timeline-item comment merge box">
<div class="timeline-avatar text {{if .Issue.PullRequest.HasMerged}}purple
{{- else if .Issue.IsClosed}}grey

View file

@ -486,6 +486,10 @@ func TestActionsPullRequestTrustPanelMergedOrClosed(t *testing.T) {
t.Run("Regular user sees pending approval even though PR is a merged PR", func(t *testing.T) {
actionsTrustTestAssertTrustPanel(t, regularSession, pullRequestLink)
})
t.Run("Owner user sees pending approval even though PR is a merged PR", func(t *testing.T) {
ownerSession := loginUser(t, ownerUser.Name)
actionsTrustTestAssertTrustPanel(t, ownerSession, pullRequestLink)
})
})
}