Fix disabling PRs (#3258)

Closes https://github.com/woodpecker-ci/woodpecker/issues/3257
This commit is contained in:
qwerty287 2024-01-22 20:46:46 +01:00 committed by GitHub
parent 6925afd83b
commit c8fa71874a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -216,7 +216,7 @@ func PostHook(c *gin.Context) {
// 5. Check if pull requests are allowed for this repo
//
if tmpPipeline.Event == model.EventPull && !repo.AllowPull {
if (tmpPipeline.Event == model.EventPull || tmpPipeline.Event == model.EventPullClosed) && !repo.AllowPull {
log.Debug().Str("repo", repo.FullName).Msg("ignoring hook: pull requests are disabled for this repo in woodpecker")
c.Status(http.StatusNoContent)
return