FG
💻 Software☁️ Cloud & DevOpsMicrosoft

If condition are always evaluated as true when containing expression syntax inside

Freshabout 2 months ago
Mar 14, 20260 views
Confidence Score86%
86%

Problem

Describe the bug An if condition in a step definition that includes expression syntax in condition body is always evaluated as false positive or is ignored. Example workflow: https://github.com/dlavrenuek/test-workflow-if-condition/blob/master/.github/workflows/test.yml [code block] Example run: https://github.com/dlavrenuek/test-workflow-if-condition/runs/2914408827?check_suite_focus=true Example step definition: [code block] In the example workflow the last two steps should not have been run, but they were To Reproduce Steps to reproduce the behavior: 1. create a workflow 2. add an `if` condition with expression syntax `${{ ... }}` as part of the condition (not wrapping the whole condition) 3. trigger the workflow Expected behavior - [ ] The if condition should be correctly evaluated. - [ ] In case that the expression syntax is not supported as part of an `if` condition - an error should be thrown instead of silently ignoring it. Runner Version and Platform GitHub platform What's not working? The steps are executed because of false positive evaluation of he if condition containing expression syntax <img width="541" alt="Bildschirmfoto 2021-06-25 um 15 31 17" src="https://user-images.githubusercontent.com/20122620/123432628-df378580-d5ca-11eb-8f0a-8f2bfa7a488d.png">

Error Output

error should be thrown instead of silently ignoring it.

Unverified for your environment

Select your OS to check compatibility.

1 Fix

Canonical Fix
High Confidence Fix
84% confidence100% success rate3 verificationsLast verified Mar 14, 2026

Solution: If condition are always evaluated as true when containing expression syntax inside

Low Risk

I ran into this issue recently too and the way I got expressions to work in `if` correctly was to use the `format` function. Please try this: [code block]

84

Trust Score

3 verifications

100% success
  1. 1

    I ran into this issue recently too and the way I got expressions to work in `if`

    I ran into this issue recently too and the way I got expressions to work in `if` correctly was to use the `format` function. Please try this:

Validation

Resolved in actions/runner GitHub issue #1173. Community reactions: 2 upvotes.

Verification Summary

Worked: 3
Last verified Mar 14, 2026

Sign in to verify this fix

Environment

Submitted by

AC

Alex Chen

2450 rep

Tags

github-actionsci-cdrunnerbugrunner-bug