actionlint
actionlint copied to clipboard
actionlint doesn't show the line the error is on in a workflow
When you run actionlint in a workflow it is unable to indicate which line the error is on:
https://github.com/toast-gear/actionlint-test/pull/3/checks

It's not possible to point the position within multi-line string (after |
) because go-yaml removes leading indentations and there is no way to know the length of the indentations from parsed YAML node.
Perhaps feedback can cover the full run segment instead of only run:
?
What does feedback mean?
Anyway, I don't think this can be implemented unless go-yaml provides length of the indentation in a YAML AST node. If someone can submit a PR to fix this issue, I would happily review it.
What does feedback mean?
Sorry, explained myself poorly. Feedback as in the underline and "full segments" would be all content in the run directive.
Anyway, I don't think this can be implemented unless go-yaml provides length of the indentation in a YAML AST node.
I came to the same conclusion.
So you mean we can get the position information from the parent node of the script string node, right? I think it would be hard.
-
go-yaml's
Node
API does not provide the end position of the node. It only provides the start position. - Even if we can know the end position of the parent node, we still need to parse its contents to get the indent of the child string node. I think it means we need to re-implement YAML parser partially. YAML has complex syntax so it would not be easy.