-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expression-based job filters (#9046)
* add section to config ref for expression job filters and use partial for operators table * add example using pipeline params too * add missing full stop * fix lint error * update wording after review * add missing to * update filters requirements definition to include string or map * remove link to paragraph
- Loading branch information
1 parent
76a8815
commit 26ff119
Showing
3 changed files
with
157 additions
and
42 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
jekyll/_includes/partials/using-expressions/operators.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[.table.table-striped] | ||
[cols=3*, options="header", stripes=even] | ||
|=== | ||
| Operator type | Operators | Description | ||
|
||
| Logical | ||
|`and`, `or` | ||
| These are short-circuiting boolean operators. | ||
|
||
| Equality | ||
| `==`, `!=` | ||
| String, numeric, and boolean equality. If the operands are of different types then `==` will evaluate `false`, and `!=` will evaluate `true`. | ||
|
||
| Equality | ||
| `starts-with` | ||
| String prefix equality, `"hello world" starts-with "hello"` evaluates as `true`. It is an error to use a non-string type as an operand. | ||
|
||
| Numeric comparison | ||
| `>=`, `>`, `<=`, `<` | ||
| Numeric comparisons. It is an error to use a non-numeric type as an operand. | ||
|
||
| Negation | ||
| `not` | ||
a| Boolean negation. | ||
|
||
Note that `not` has very high precedence and so binds very tightly. Use sub-expressions to apply `not` to more complex expressions. For example, with `foo` being `true` and `bar` being `false`: | ||
|
||
* `not foo and bar` evaluates to `false` | ||
* `not (foo and bar)` evaluates to `true` | ||
|=== |