Open Kurt-von-Laven opened 2 years ago
Yeah, aliases are actually not considered because I've never used them in my workflows and anyone didn't report that previously. But I agree this should not cause false positive at least.
I created a minimal workflow to reproduce this:
name: Test
on: push
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Run my-action.
uses: my-organization/my-action@main
with: &my-action-inputs
a: b
c: d
e: f
- name: Run my-action again.
uses: my-organization/my-action@main
with: *my-action-inputs
Consider also yaml anchors (if you didn't already) Example:
name: Test
on: push
jobs:
test1:
runs-on: ubuntu-latest
steps:
- &run_action
name: Run my-action
uses: my-organization/my-action@main
test2:
runs-on: ubuntu-latest
steps:
- name: Restore built artifacts from cache
<<: *run_action
I see a false positive on most aliases. This manifests as:
.github/workflows/terraform_apply_promote.yml:27:26: expected scalar node for string value but found alias node with "" tag [syntax-check]
|
27 | terraform_version: *tf_ver
As it stands, if being used in superlinter, we cannot even use the command line to override this, since the exclusions aren't available in actionlint.yml. At this point we are left with:
All of which are sub-optimal. it suggests that the way this is linting is some AST that is running before aliases are resolved.
This doesn't solve your problem, but to toot my own horn, MegaLinter runs significantly faster than Super-Linter, and has many more linters. It also has actionlint.
Actionlint complains
"with" section is alias node but mapping node is expected [syntax-check]
on valid YAML syntax when anchors and aliases are used with mapping nodes:I am uncertain how one would suppress the error.