func()

in lib/notifiers/notifiers.go [167:181]


func (c *CELPredicate) Apply(_ context.Context, build *cbpb.Build) bool {
	out, _, err := c.prg.Eval(map[string]interface{}{"build": build})
	if err != nil {
		log.Errorf("failed to evaluate the CEL filter: %v", err)
		return false
	}

	match, ok := out.Value().(bool)
	if !ok {
		log.Errorf("failed to convert output %v of CEL filter program to a boolean: %v", out, err)
		return false
	}

	return match
}