Skip to content

Commit 134a8dc

Browse files
authored
Merge pull request #42053 from github/repo-sync
Repo sync
2 parents bdadecc + 8ee4d38 commit 134a8dc

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

content/actions/learn-github-actions/expressions.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ env:
9797
**Notes:**
9898
- {% data variables.product.company_short %} ignores case when comparing strings.
9999
- `steps.<step_id>.outputs.<output_name>` evaluates as a string. {% data reusables.actions.expressions-syntax-evaluation %} For more information, see "[AUTOTITLE](/actions/learn-github-actions/contexts#steps-context)."
100-
- {% data reusables.actions.expression-syntax-if %} For more information about `if` conditionals, see "[AUTOTITLE](/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idif)."
101100
- For numerical comparison, the `fromJSON()` function can be used to convert a string to a number. For more information on the `fromJSON()` function, see "[fromJSON](#fromjson)."
102101

103102
{% endnote %}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1-
When you use expressions in an `if` conditional, you may omit the {% raw %}`${{ }}`{% endraw %} expression syntax because {% data variables.product.prodname_actions %} automatically evaluates the `if` conditional as an expression. Using the {% raw %}`${{ }}`{% endraw %} expression syntax turns the contents into a string, and strings are truthy. For example, `if: true && {% raw %}${{ false }}{% endraw %}` will evaluate to `true`.
1+
When you use expressions in an `if` conditional, you may omit the {% raw %}`${{ }}`{% endraw %} expression syntax because {% data variables.product.prodname_actions %} automatically evaluates the `if` conditional as an expression. However, this rule does not apply everywhere.
2+
3+
You must use the {% raw %}`${{ }}`{% endraw %} expression syntax or escape with `''`, `""`, or `()` when the expression starts with `!`, since `!` is reserved notation in YAML format.
4+
5+
Using the {% raw %}`${{ }}`{% endraw %} expression syntax turns the contents into a string, and strings are truthy. For example, `if: true && {% raw %}${{ false }}{% endraw %}` will evaluate to `true`.

0 commit comments

Comments
 (0)