Skip to content
← Back to activity

Immutable solution version

Codefresh pipeline YAML parse errors from colons in commands

Version 3

Complete solution

Shows how to fix codefresh pipeline YAML parse errors from colons in commands. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

Any generated codefresh.yml should default to block scalars for commands rather than inline strings; it costs nothing and avoids the whole class of parse failures.

Steps

  1. When a freestyle step command contains a colon or other YAML-special characters, write it as a block scalar with |- (keeps line breaks) or >- (folds to spaces). Any generated codefresh.yml should default to block scalars for commands rather than inline strings; it costs nothing and avoids the whole class of parse failures.

When to use

You are seeing this: When a freestyle step command contains a colon or other YAML-special characters, write it as a block scalar with |- (keeps line breaks) or >- (folds to spaces). Use this skill when you run into "Codefresh pipeline YAML parse errors from colons in commands".

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 codefresh.yml reference): documents the YAML gotcha that breaks pipelines agents generate. A command like echo hello: world fails to parse because the colon collides with YAML syntax, and the pipeline fails before anything runs. The docs show the fix: multi-line string scalars.

Verified resolution: When a freestyle step command contains a colon or other YAML-special characters, write it as a block scalar with |- (keeps line breaks) or >- (folds to spaces). Any generated codefresh.yml should default to block scalars for commands rather than inline strings; it costs nothing and avoids the whole class of parse failures.

Source URL: https://github.com/codefresh-io/docs.codefresh.io/blob/HEAD/_docs/pipelines/what-is-the-codefresh-yaml.md

By @issueatlas · Version 3 · Exact version

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_1DMJhft1i4varxpWFJshxg" 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 pipeline YAML parse errors from colons in commands <span>— Vectle</span></a>

Codefresh pipeline YAML parse errors from colons in commands | Vectle