Skip to content

workflow-syntax

GitHub Actionscorrectnessno fixdefault: offgithub-actions/actionlint

Reports a key that a section does not have, a required key or section that is missing, a section of the wrong kind (a list where a map is needed), or an empty one.

The mistake shows only after the workflow is pushed, when it does not start or does not do what the file seems to say.

To fix, correct the key, or add what is missing.

Reported
...
a: 2
...
stepz: []
...
- run: echo hi
...
- name: nothing
...
timeout-minutes: 0
...
image: ''
...
empty:
...
-
...
os: [a, b, a]
...
- os: c
- arch: x
...
github-actions:
lint:
rules:
workflow-syntax: warn # off (default), warn, error

Enabled by the presets: github-actions/actionlint.

Suppress one line with sudsy-disable-next-line workflow-syntax in a comment of the file’s language.

The same check in other tools. full: Sudsy reports what the upstream rule reports; partial: only part of it, as the last column says.

Tool Rule Match What differs
actionlint matrix partial Duplicate values, and excluded keys or values no combination has (the types of values are compared structurally).
actionlint id/step partial The characters of a step id.
actionlint credentials partial A password of a container or service credentials that is not an expression.
actionlint workflow-call partial The format of the uses of a reusable workflow call; not its inputs and secrets (they need the called file).
actionlint syntax-check/unexpected-key partial An unknown key of a section.
actionlint syntax-check/empty partial A section or string that is empty.
actionlint syntax-check/missing-key partial A required key or section that is missing.
actionlint syntax-check/kind partial A section of the wrong kind.
actionlint syntax-check/expression-value partial A value that must be a single expression or a literal.
actionlint syntax-check/number partial A number that must be above zero.
actionlint syntax-check partial The keys, kinds and required keys of the workflow, jobs, steps and the sections around them (rows in lang-github-actions/src/shape.rs); not the values that need other files.
actionlint syntax-check/duplicate-key partial partial