Skip to content
Latchkey

Gitea Actions "workflow is invalid" in CI

Gitea parsed the workflow file but it does not conform to the Actions schema (a missing required key, a bad structure). The run is rejected before any job starts, and the error names the failing field.

What this error means

A run is created but immediately marked failed with a workflow validation error, or the Actions tab shows the workflow could not be parsed into jobs.

Gitea Actions
workflow is not valid. .gitea/workflows/ci.yml: yaml: line 6:
mapping values are not allowed in this context

Common causes

A structural or indentation error in the YAML

Mismatched indentation or a mapping in the wrong place is valid text but an invalid workflow structure.

A missing required key

Omitting runs-on, jobs, or steps where required makes the workflow fail schema validation.

How to fix it

Fix the field the error names

  1. Read the file and line in the validation message.
  2. Correct the indentation or add the missing required key.
  3. Push again and confirm the workflow parses into jobs.
.gitea/workflows/ci.yml
jobs:
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - run: make build

Lint the workflow before pushing

Validate the YAML structure locally so schema errors surface before they reach the instance.

Terminal
yamllint .gitea/workflows/ci.yml

How to prevent it

  • Lint workflow YAML in a pre-commit hook.
  • Copy from a known-good workflow when starting a new one.
  • Keep two-space indentation consistent throughout.

Related guides

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