1
0
mirror of https://github.com/woodpecker-ci/woodpecker.git synced 2024-11-30 08:06:52 +02:00

Merge pull request #1178 from chengweiv5/fix-hook

Fix hook check logic
This commit is contained in:
Brad Rydzewski 2015-09-01 09:55:44 -07:00
commit 1ea93452b3

View File

@ -67,11 +67,11 @@ func PostHook(c *gin.Context) {
log.Warnf("ignoring hook. repo %s has no owner.", repo.FullName)
c.Writer.WriteHeader(204)
return
case !repo.Hooks.Push && hook.PullRequest != nil:
case !repo.Hooks.Push && hook.Commit != nil:
log.Infof("ignoring hook. repo %s is disabled.", repo.FullName)
c.Writer.WriteHeader(204)
return
case !repo.Hooks.PullRequest && hook.PullRequest == nil:
case !repo.Hooks.PullRequest && hook.PullRequest != nil:
log.Warnf("ignoring hook. repo %s is disabled for pull requests.", repo.FullName)
c.Writer.WriteHeader(204)
return