mpalmer / action-validator

Tool to validate GitHub Action and Workflow YAML files
GNU General Public License v3.0
271 stars 25 forks source link

Wrong variable definition not captured #45

Open habutre opened 1 year ago

habutre commented 1 year ago

Hi @mpalmer

I have stumbled in a tiny issue but since I am a foreign in Rust I do not feel able to propose a PR

when I define an env var like below I got no complains from action-validator

$ {{ vars.MY_VAR }}

When my action runs, it does not substitute the variable value as expected instead just print the literal value $ {{ vars.MY_VAR }}

I believe that the validator could mark it as an issue suggesting (nice to have) the follow as remediation

${{ vars.MY_VAR }}
mpalmer commented 1 year ago

Hi Rogério,

This feels like a facet of what would be caught by a solid implementation of #22 -- although the particular problem mentioned in that feature request is missing braces, a parser/validator for expressions would presumably also catch a $ { typo.

I'll mark this as pr-welcome as well, and hopefully someone will do the necessary at some point.