From c36bf0d5ee530d39b3e1ad4ec12a365068ebe8c5 Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Thu, 21 Feb 2019 11:10:56 -0800 Subject: [PATCH] only check no fork logic if pull request --- trigger/trigger.go | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/trigger/trigger.go b/trigger/trigger.go index 73d58aa2..cbda960e 100644 --- a/trigger/trigger.go +++ b/trigger/trigger.go @@ -78,13 +78,15 @@ func (t *triggerer) Trigger(ctx context.Context, repo *core.Repository, base *co logger.Infoln("trigger: skipping hook. found skip directive") return nil, nil } - if repo.IgnorePulls && base.Event == core.EventPullRequest { - logger.Infoln("trigger: skipping hook. project ignores pull requests") - return nil, nil - } - if repo.IgnoreForks && !strings.EqualFold(base.Fork, repo.Slug) { - logger.Infoln("trigger: skipping hook. project ignores forks") - return nil, nil + if base.Event == core.EventPullRequest { + if repo.IgnorePulls { + logger.Infoln("trigger: skipping hook. project ignores pull requests") + return nil, nil + } + if repo.IgnoreForks && !strings.EqualFold(base.Fork, repo.Slug) { + logger.Infoln("trigger: skipping hook. project ignores forks") + return nil, nil + } } user, err := t.users.Find(ctx, repo.UserID)