diff --git a/common/config.go b/common/config.go index 1d9cf07eb..94b5a8fe0 100644 --- a/common/config.go +++ b/common/config.go @@ -105,3 +105,17 @@ func (c *Condition) MatchOwner(owner string) bool { return c.Owner == owner } } + +// MatchMatrix is a helper function that returns false +// to limit steps to only certain matrix axis. +func (c *Condition) MatchMatrix(matrix map[string]string) bool { + if len(c.Matrix) == 0 { + return true + } + for k, v := range c.Matrix { + if matrix[k] != v { + return false + } + } + return true +}