From 0fe93b4ae1ac6b0eeb4ba51597121d2323790b63 Mon Sep 17 00:00:00 2001
From: Akhilesh Tiwari <87492404+silky-x0@users.noreply.github.com>
Date: Mon, 12 May 2025 12:51:33 +0530
Subject: [PATCH 1/2] Update evaluate-expressions-in-workflows-and-actions.md

Explained how operators are used.

issue-#37006
---
 ...te-expressions-in-workflows-and-actions.md | 44 ++++++++++++++++---
 1 file changed, 37 insertions(+), 7 deletions(-)

diff --git a/content/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions.md b/content/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions.md
index 192511a3b8ef..8abd0c1712f5 100644
--- a/content/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions.md
+++ b/content/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions.md
@@ -109,21 +109,51 @@ env:
 * {% data variables.product.prodname_dotcom %} ignores case when comparing strings.
 * Objects and arrays are only considered equal when they are the same instance.
 
-{% data variables.product.prodname_dotcom %} offers ternary operator like behaviour that you can use in expressions. By using a ternary operator in this way, you can dynamically set the value of an environment variable based on a condition, without having to write separate if-else blocks for each possible option.
-
-### Example
+% data variables.product.prodname_dotcom %} provides a way to create conditional logic in expressions using binary logical operators (`&&` and `||`). This pattern can be used to achieve similar functionality to the ternary operator (`?:`) found in many programming languages, while actually using only binary operators.
 
+## Example:
 {% raw %}
-
 ```yaml
 env:
   MY_ENV_VAR: ${{ github.ref == 'refs/heads/main' && 'value_for_main_branch' || 'value_for_other_branches' }}
 ```
-
 {% endraw %}
 
-In this example, we're using a ternary operator to set the value of the `MY_ENV_VAR` environment variable based on whether the {% data variables.product.prodname_dotcom %} reference is set to `refs/heads/main` or not. If it is, the variable is set to `value_for_main_branch`. Otherwise, it is set to `value_for_other_branches`.
-It is important to note that the first value after the `&&` must be truthy. Otherwise, the value after the `||` will always be returned.
+In this example, we're using logical operators to set the value of the `MY_ENV_VAR` environment variable based on whether the {% data variables.product.prodname_dotcom %} reference is set to `refs/heads/main` or not.
+
+### How It Works
+
+This expression uses two binary operators:
+- `&&` (logical AND): Returns the right operand if the left operand is truthy, otherwise returns the left operand
+- `||` (logical OR): Returns the left operand if it's truthy, otherwise returns the right operand
+
+### Order of Operations
+
+The order of operations is important to understand:
+1. The equality comparison (`==`) is evaluated first
+2. The logical AND (`&&`) has higher precedence than logical OR (`||`)
+3. The expression is evaluated as `(github.ref == 'refs/heads/main' && 'value_for_main_branch') || 'value_for_other_branches'`
+
+### Step-by-Step Evaluation
+
+When `github.ref == 'refs/heads/main'` is true:
+1. `github.ref == 'refs/heads/main'` evaluates to `true`
+2. `true && 'value_for_main_branch'` evaluates to `'value_for_main_branch'`
+3. `'value_for_main_branch' || 'value_for_other_branches'` evaluates to `'value_for_main_branch'`
+
+When `github.ref == 'refs/heads/main'` is false:
+1. `github.ref == 'refs/heads/main'` evaluates to `false`
+2. `false && 'value_for_main_branch'` evaluates to `false`
+3. `false || 'value_for_other_branches'` evaluates to `'value_for_other_branches'`
+
+### Important Considerations
+
+- This is NOT a true ternary operator (which would take the form `condition ? true_value : false_value`), but rather two binary operators arranged to achieve similar functionality
+- The expression after `&&` must evaluate to a truthy value to work correctly
+- If the expression after `&&` is falsy (empty string, zero, false, null), the value after `||` will be returned even if the initial condition is true
+- The evaluation follows standard JavaScript-like operator precedence rules
+
+For complex conditional logic, you might prefer using job conditionals or separate if-steps.
 
 ## Functions
 

From c8178039236c7b2c55180416cffff8b586f9c3ee Mon Sep 17 00:00:00 2001
From: Akhilesh Tiwari <87492404+silky-x0@users.noreply.github.com>
Date: Fri, 30 May 2025 12:50:07 +0530
Subject: [PATCH 2/2] Update evaluate-expressions-in-workflows-and-actions.md

Removed Unnecessary explanations
---
 ...te-expressions-in-workflows-and-actions.md | 44 -------------------
 1 file changed, 44 deletions(-)

diff --git a/content/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions.md b/content/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions.md
index 8abd0c1712f5..4e5029e6f4e2 100644
--- a/content/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions.md
+++ b/content/actions/writing-workflows/choosing-what-your-workflow-does/evaluate-expressions-in-workflows-and-actions.md
@@ -111,50 +111,6 @@ env:
 
 % data variables.product.prodname_dotcom %} provides a way to create conditional logic in expressions using binary logical operators (`&&` and `||`). This pattern can be used to achieve similar functionality to the ternary operator (`?:`) found in many programming languages, while actually using only binary operators.
 
-## Example:
-{% raw %}
-```yaml
-env:
-  MY_ENV_VAR: ${{ github.ref == 'refs/heads/main' && 'value_for_main_branch' || 'value_for_other_branches' }}
-```
-{% endraw %}
-
-In this example, we're using logical operators to set the value of the `MY_ENV_VAR` environment variable based on whether the {% data variables.product.prodname_dotcom %} reference is set to `refs/heads/main` or not.
-
-### How It Works
-
-This expression uses two binary operators:
-- `&&` (logical AND): Returns the right operand if the left operand is truthy, otherwise returns the left operand
-- `||` (logical OR): Returns the left operand if it's truthy, otherwise returns the right operand
-
-### Order of Operations
-
-The order of operations is important to understand:
-1. The equality comparison (`==`) is evaluated first
-2. The logical AND (`&&`) has higher precedence than logical OR (`||`)
-3. The expression is evaluated as `(github.ref == 'refs/heads/main' && 'value_for_main_branch') || 'value_for_other_branches'`
-
-### Step-by-Step Evaluation
-
-When `github.ref == 'refs/heads/main'` is true:
-1. `github.ref == 'refs/heads/main'` evaluates to `true`
-2. `true && 'value_for_main_branch'` evaluates to `'value_for_main_branch'`
-3. `'value_for_main_branch' || 'value_for_other_branches'` evaluates to `'value_for_main_branch'`
-
-When `github.ref == 'refs/heads/main'` is false:
-1. `github.ref == 'refs/heads/main'` evaluates to `false`
-2. `false && 'value_for_main_branch'` evaluates to `false`
-3. `false || 'value_for_other_branches'` evaluates to `'value_for_other_branches'`
-
-### Important Considerations
-
-- This is NOT a true ternary operator (which would take the form `condition ? true_value : false_value`), but rather two binary operators arranged to achieve similar functionality
-- The expression after `&&` must evaluate to a truthy value to work correctly
-- If the expression after `&&` is falsy (empty string, zero, false, null), the value after `||` will be returned even if the initial condition is true
-- The evaluation follows standard JavaScript-like operator precedence rules
-
-For complex conditional logic, you might prefer using job conditionals or separate if-steps.
-
 ## Functions
 
 {% data variables.product.prodname_dotcom %} offers a set of built-in functions that you can use in expressions. Some functions cast values to a string to perform comparisons. {% data variables.product.prodname_dotcom %} casts data types to a string using these conversions: