Skip to content

no-recursive-alias

GitHub ActionsYAMLcorrectnessno fixdefault: errorgithub-actions/actionlint

Reports an alias that is inside the node of its own anchor, which makes the data refer to itself.

The data is then a loop with no end. Parsers either refuse the file or build a cyclic structure that breaks the first program that walks it, for example when it is printed or converted to JSON.

To fix, remove the alias or move it out of the anchored node.

Reported
a: &x
b: *x
c: &y 1
d: *y
e: &z
...
github-actions:
lint:
rules:
no-recursive-alias: error # off, warn, error (default)
yaml:
lint:
rules:
no-recursive-alias: error # off, warn, error (default)

Enabled by the presets: github-actions/actionlint.

Suppress one line with sudsy-disable-next-line no-recursive-alias 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 syntax-check/recursive-alias partial The shared reference rule, enabled by the preset for workflows.