Skip to content

YamlSyntaxError

YAML syntax error.

Defined by ValidationRule which supports workflows, actions, invalid content in the "Internal" ruleset along with YamlLoadError, JsonSchemaValidation.

Description

A syntactically correct YAML file is required to ensure the YAML file can be loaded.

Fix the problems in the workflow file to make it a valid YAML file.

GitHub would also very likely reject the file with an error message similar to:

Invalid workflow file: .github/workflows/test.yml#L5
The workflow is not valid. .github/workflows/test.yml (Line: 5, Col: 17): Error message

Compliant example

Valid yaml file.

example.yml

on: push
jobs:
  example:
    uses: reusable/workflow.yml

Non-compliant example

Tabs cannot be used as indentation.

example.yml

on: push
jobs:
  example:
      uses: reusable/workflow.yml

  • Line 1: File example.yml could not be parsed:
    java.lang.IllegalArgumentException: Failed to parse YAML: while scanning for the next token
    found character '\t(TAB)' that cannot start any token. (Do not use \t(TAB) for indentation)
     in reader, line 3, column 1:
           example:
        ^
    <br/>