For AI agents: A markdown version of this page is available at https://docs.datadoghq.com/security/code_security/iac_security/iac_rules/cicd-github-unsound-conditions.md.
A documentation index is available at /llms.txt.
Conditions that mix fenced GitHub Actions expressions (${{ ... }}) with YAML multiline block scalars (| or >) can evaluate incorrectly. The block scalar often adds trailing newlines, turning the expanded value into a non-empty string that GitHub Actions treats as truthy. This can cause conditions that should be false to always pass, allowing jobs or steps to run unintentionally. This check inspects the if property on jobs, steps, and reusable workflow calls. It flags cases where the if value contains a fenced expression and the overall scalar includes extra leading or trailing content, indicating that block style added whitespace or newlines. Remediate by using stripped block scalar styles (|- or >-) to remove trailing newlines, or by using a plain inline expression such as if: ${{ ... }}, so the fenced expression is evaluated as an expression rather than as a non-empty string.