Skip to content

Commit

Permalink
Update file Readme, add info about complex expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
dmvict committed Nov 19, 2024
1 parent 2be5ba8 commit 037c469
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,29 @@ Example of condition with check of current step output:
option2: value
```

**How to use complex conditions**

The library used for evaluating expressions does not account for operator precedence, which can lead to incorrect results in complex expressions where the order of operations is crucial.

Example of the issue. Consider the following expression:
```yaml
'main' == 'main' && 'main' != 'master'
```

Due to the library's evaluation method, this expression is interpreted as:
```yaml
(('main' == 'main') && 'main') != 'master'
```

As a result, it evaluates to `false`, which is not the intended outcome.

To ensure that the expression is evaluated correctly, you can use parentheses to explicitly define the order of operations. The corrected expression should be written as:
```yaml
('main' == 'main') && ('main' != 'master')
```

This adjustment clarifies the intended precedence and will yield the correct result.

### `github_token`

A token to access private actions. Does not required for public actions.
Expand Down

0 comments on commit 037c469

Please sign in to comment.