mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2024-11-04 16:09:33 +00:00
Fix hook check logic
Signed-off-by: Chengwei Yang <yangchengwei@qiyi.com>
This commit is contained in:
parent
370e53da1e
commit
8bfc155aee
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue