Fix approval requirement if PR is closed (#4902)

This commit is contained in:
qwerty287 2025-02-26 17:11:34 +02:00 committed by GitHub
parent 64578bff46
commit 4bf5116a52
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -48,13 +48,13 @@ func needsApproval(repo *model.Repo, pipeline *model.Pipeline) bool {
// repository requires approval for pull requests from forks
case model.RequireApprovalForks:
if pipeline.Event == model.EventPull && pipeline.FromFork {
if (pipeline.Event == model.EventPull || pipeline.Event == model.EventPullClosed) && pipeline.FromFork {
return true
}
// repository requires approval for pull requests
case model.RequireApprovalPullRequests:
if pipeline.Event == model.EventPull {
if pipeline.Event == model.EventPull || pipeline.Event == model.EventPullClosed {
return true
}