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.
workflow is not valid. .gitea/workflows/ci.yml: yaml: line 6:
mapping values are not allowed in this contextCommon 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
- Read the file and line in the validation message.
- Correct the indentation or add the missing required key.
- Push again and confirm the workflow parses into jobs.
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: make buildLint the workflow before pushing
Validate the YAML structure locally so schema errors surface before they reach the instance.
yamllint .gitea/workflows/ci.ymlHow 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.