GitHub Actions - You have an error in your yaml syntax

Viewed 7519
1 Answers

It's correct that the number of spaces can be freely chosen, but for the same node it has to be equal.

This is a mapping with two keys:

name: Checkout code
uses: actions/checkout@v2

but if you write it like this:

name: Checkout code
  uses: actions/checkout@v2

then the uses: ... is seen as a continuation of the previous value for name. But it's invalid, because colons plus spaces aren't allowed in mapping values.

If it looked like that:

name: Checkout code
  more

it would be valid YAML, equal to:

name: Checkout code more

So inside of that mapping, always use the same amount of spaces.

May I also recommend my short tutorial?

Related