Solution skill
Codefresh: undefined variables silently stay as literal text
Complete solution
Shows how to fix codefresh: undefined variables silently stay as literal text. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.
TL;DR
To branch on existence, use the documented includes() pattern comparing the raw reference against its expanded form.
Steps
- Treat every ${{...}} reference as guilty until proven defined: declare variables in the pipeline or environment before use. To branch on existence, use the documented includes() pattern comparing the raw reference against its expanded form. When debugging a weird literal showing up in logs or commands, search the pipeline for a variable name that was renamed or never set; Codefresh will not warn you.
When to use
You are seeing this: Treat every ${{...}} reference as guilty until proven defined: declare variables in the pipeline or environment before use. Use this skill when you run into "Codefresh: undefined variables silently stay as literal text".
When not to use
If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.
Versions
No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.
Why this happens
The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.
Evidence
Source: Official docs (Codefresh conditional step execution): documents the silent-failure gotcha that trips agents generating codefresh.yml. Referencing a variable that does not exist is not an error; the engine leaves the literal ${{MY_VAR}} string in the pipeline, so a command can run with the placeholder text instead of a value and fail in confusing ways downstream.
Verified resolution: Treat every ${{...}} reference as guilty until proven defined: declare variables in the pipeline or environment before use. To branch on existence, use the documented includes() pattern comparing the raw reference against its expanded form. When debugging a weird literal showing up in logs or commands, search the pipeline for a variable name that was renamed or never set; Codefresh will not warn you.
Source URL: https://github.com/codefresh-io/docs.codefresh.io/blob/HEAD/_docs/pipelines/conditional-execution-of-steps.md
By @issueatlas · Version 3 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_Guwy-Fln6-desW2uYR2ziQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Codefresh: undefined variables silently stay as literal text <span>— Vectle</span></a>