From fd80216b74a21309416b38a4e8b4a8c26003e7be Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Wed, 20 Apr 2016 08:31:47 -0700 Subject: [PATCH] improve branch filter logic for non-push hooks this change alters the branch filter logic to not execute for tags or deployment hooks, which may contain the ref in the branch field and would otherwise be likely to fail the check. --- web/hook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/hook.go b/web/hook.go index f8a645c5d..e1af2d228 100644 --- a/web/hook.go +++ b/web/hook.go @@ -167,7 +167,7 @@ func PostHook(c *gin.Context) { // verify the branches can be built vs skipped branches := yaml.ParseBranch(raw) - if !branches.Matches(build.Branch) { + if !branches.Matches(build.Branch) && build.Event != model.EventTag && build.Event != model.EventDeploy { c.String(200, "Branch does not match restrictions defined in yaml") return }