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.
This commit is contained in:
Brad Rydzewski 2016-04-20 08:31:47 -07:00
parent c613571bd6
commit fd80216b74

View file

@ -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
}