mirror of
https://github.com/woodpecker-ci/woodpecker.git
synced 2025-01-17 17:45:03 +02:00
ability to run a build step conditionally based on matrix
This commit is contained in:
parent
b9484757ff
commit
062a31de08
@ -105,3 +105,17 @@ func (c *Condition) MatchOwner(owner string) bool {
|
|||||||
return c.Owner == owner
|
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
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user