Skip to content
Latchkey

What Is YAML? YAML Aint Markup Language Explained

YAML is a human-friendly, indentation-based data format used to write configuration like CI workflows, Kubernetes manifests, and tool settings.

YAML (a recursive acronym for "YAML Aint Markup Language") is the format most CI/CD pipelines are written in. It uses indentation instead of brackets, which makes it pleasant to read and write by hand, but that same whitespace sensitivity is the source of most YAML mistakes. If you have edited a .github/workflows file, you have written YAML.

What YAML is

YAML represents the same data as JSON - maps (key-value pairs), sequences (lists), and scalars (strings, numbers, booleans) - but uses indentation and dashes instead of braces and brackets. It is a strict superset of JSON, so JSON is also valid YAML. It supports comments, multiline strings, and reusable anchors, which is why config authors prefer it.

Indentation is significant

YAML uses spaces (never tabs) to express nesting, so a single misaligned line can change a key from a child to a sibling and silently alter meaning. This is the most common source of broken workflow files. Most editors and linters can flag indentation errors before they reach CI.

Gotchas: the Norway problem and types

YAML guesses types, which causes surprises. The classic is the "Norway problem": the country code "NO" gets parsed as the boolean false. Unquoted version numbers like 1.20 can lose a trailing zero by becoming a float. Quoting ambiguous scalars as strings avoids these traps.

YAML in CI workflows

GitHub Actions, GitLab CI, CircleCI, and most pipeline tools define their workflows in YAML. You declare jobs, steps, triggers, and matrices as nested maps and lists. Because indentation matters, validating the file with a YAML linter in a pre-commit hook saves a lot of failed runs.

A workflow file is YAML
# A minimal GitHub Actions workflow in YAML
name: CI
on: [push]
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: echo "hello"

Latchkey note

You select Latchkey managed runners by changing one YAML value - the runs-on label - in your existing workflow file. No new syntax and no separate config format: the rest of your YAML pipeline stays exactly as it is.

Key takeaways

  • YAML is an indentation-based, human-friendly data format and a strict superset of JSON.
  • Whitespace is significant and tabs are forbidden, so most YAML bugs are indentation mistakes.
  • It is the default format for CI workflow files, so a YAML linter in CI prevents many failures.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →