diff --git a/server/api/hook.go b/server/api/hook.go index cc247bac8..91abc3971 100644 --- a/server/api/hook.go +++ b/server/api/hook.go @@ -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