Skip to content

Commit 64769c8

Browse files
guillep2klafriks
authored andcommitted
Allow authors to use act keywords in PR content (#9059)
1 parent b15f26b commit 64769c8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

models/issue_xref.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,14 @@ func (issue *Issue) verifyReferencedIssue(e Engine, ctx *crossReferencesContext,
178178
if !perm.CanReadIssuesOrPulls(refIssue.IsPull) {
179179
return nil, references.XRefActionNone, nil
180180
}
181+
// Accept close/reopening actions only if the poster is able to close the
182+
// referenced issue manually at this moment. The only exception is
183+
// the poster of a new PR referencing an issue on the same repo: then the merger
184+
// should be responsible for checking whether the reference should resolve.
181185
if ref.Action != references.XRefActionNone &&
182186
ctx.Doer.ID != refIssue.PosterID &&
183-
!perm.CanWriteIssuesOrPulls(refIssue.IsPull) {
187+
!perm.CanWriteIssuesOrPulls(refIssue.IsPull) &&
188+
(refIssue.RepoID != ctx.OrigIssue.RepoID || ctx.OrigComment != nil) {
184189
refAction = references.XRefActionNone
185190
}
186191
}

0 commit comments

Comments
 (0)