Invalid workflow file CI/CD Origin: Build & delivery Last updated 25 Oct 2026

GitHub Actions: Invalid workflow file: .github/workflows/ci.yml#L12 — You have an error in your yaml syntax on line 12

GitHub could not parse your workflow YAML, so no run was created — usually indentation, a tab, or an unquoted special character.

Exact message you may see Invalid workflow fileYou have an error in your yaml syntax on lineInvalid workflow file: .github/workflowsmapping values are not allowed in this contextA mapping was not expected

Meaning

The Actions tab shows a red banner with the file and line. YAML is strict: indentation must use spaces, a colon followed by a space starts a value, and strings that contain :, #, *, { or start with % or @ must be quoted. Wrong keys (runs_on) give a different "unexpected value" error but the same banner.

Common causes

  • Tab characters or inconsistent indentation
  • Unquoted string containing : , # or a leading * / @ / %
  • Misspelled or misplaced key (runs_on, step: instead of steps:)
  • Expression ${{ }} with unbalanced braces or quotes
  • Duplicate keys or a list item at the wrong level

⚡ Quick fix

  1. Go to the line number in the message and check indentation first
  2. Quote values that contain : or #
  3. Lint locally with actionlint or yamllint before pushing

Detailed fix by platform

GitHub Actions

  1. Install actionlint and run actionlint in the repo root (also available as a pre-commit hook and VS Code extension)

Linux

  1. python3 -c "import yaml,sys; yaml.safe_load(open('.github/workflows/ci.yml'))" prints the exact YAML parse error with line and column

Code examples

A frequent mistake and its fix

yaml
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - name: "Build: release"        # quote values that contain ': '
        run: echo "ok"
      - uses: actions/checkout@v4     # 2-space indent, no tabs

How to diagnose

  1. Line — Which line does the banner point at?
  2. Whitespace — Tabs or mixed indentation?
  3. Lint — Does actionlint report more?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: Build & delivery. Errors that are often confused with or caused by this one (click to open):

.gitlab-ci.yml invalid — GitLab CI: Found errors in your .gitlab-ci.yml: jobs:build config contains unknown keys: scripts (CI/CD).gitlab-ci.yml invalidAPI rate limit exceeded — GitHub Actions: HttpError: API rate limit exceeded for installation ID 123456 / secondary rate limit (CI/CD)API rate limit exceed…Config compilation failed — CircleCI: Error calling workflow: 'build'. Cannot find a definition for job named test / Config does not conform to schema (CI/CD)Config compilation fa…Credentials could not be loaded — GitHub Actions: Error: Credentials could not be loaded, please check your action inputs: Could not load credentials from any providers (CI/CD)Credentials could not…error parsing called workflow — GitHub Actions: error parsing called workflow ".github/workflows/ci.yml" -> "org/repo/.github/workflows/build.yml@main": workflow was not found (CI/CD)error parsing called …Expected — Waiting for status to be reported — GitHub Actions: Expected — Waiting for status to be reported (required check never runs on the pull request) (CI/CD)Expected — Waiting fo…Matrix vector does not contain any values — GitHub Actions: Matrix vector 'node' does not contain any values / Error when evaluating 'strategy' for job (CI/CD)Matrix vector does no…Unable to download artifact — GitHub Actions: Error: Unable to download artifact(s): Artifact not found for name: build (CI/CD)Unable to download ar…Invalid w…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.