Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

READY: Update action description, add info about complex conditions #178

Merged
merged 1 commit into from
Nov 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,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