Skip to content

Commit c1f2f46

Browse files
authored
Merge pull request #2307 from alexissellier/add-is-in-doc
docs: add is_in function documentation
2 parents b88cb66 + cb2d020 commit c1f2f46

4 files changed

Lines changed: 47 additions & 0 deletions

File tree

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
The function `is_in` checks if the first argument can be found in the second argument.
2+
3+
## Arguments
4+
5+
### `[arg1 arg2]`
6+
7+
```
8+
is_in [arg1] [arg2]
9+
```
10+
11+
### Example
12+
13+
Use `is_in` as a function under your pipeline definitions:
14+
15+
```yaml
16+
pipelines:
17+
dev:
18+
run: |-
19+
is_in apples "apples peaches"
20+
```
21+
Returns exit status 0
22+
23+
```yaml
24+
pipelines:
25+
dev:
26+
run: |-
27+
is_in apples "peaches bananas"
28+
```
29+
Returns exist status 1 (fatal)

docs/pages/configuration/_partials/functions/group_checks.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ import PartialIsos from "./is_os.mdx"
77
import PartialIsequal from "./is_equal.mdx"
88
import PartialIsempty from "./is_empty.mdx"
99
import PartialIsdependency from "./is_dependency.mdx"
10+
import PartialIsin from "./is_in.mdx"
1011

1112
<PartialIsdependency />
1213
<PartialIsempty />
1314
<PartialIsequal />
15+
<PartialIsin />
1416
<PartialIsos />
1517
<PartialIstrue />
1618

docs/pages/configuration/_partials/functions/group_checks_global.mdx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,12 @@ import PartialIsos from "./is_os.mdx"
77
import PartialIsequal from "./is_equal.mdx"
88
import PartialIsempty from "./is_empty.mdx"
99
import PartialIsdependency from "./is_dependency.mdx"
10+
import PartialIsin from "./is_in.mdx"
1011

1112
<PartialIsdependency />
1213
<PartialIsempty />
1314
<PartialIsequal />
15+
<PartialIsin />
1416
<PartialIsos />
1517
<PartialIstrue />
1618

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
2+
3+
<details className="config-field -function" data-expandable="false">
4+
<summary>
5+
6+
### `is_in` <span className="config-field-type">[value-1] [value-2]</span> <span className="config-field-enum"></span> <span className="config-field-default -return">bool</span> <span className="config-field-required" data-required="false">pipeline only</span> {#is_in}
7+
8+
Returns true if value of the first argument can be found in the second argument (second argument beeing a blank-separated list of strings e.g `"bananas apples peaches"`)
9+
10+
</summary>
11+
12+
13+
14+
</details>

0 commit comments

Comments
 (0)