mpalmer / action-validator

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

(Feature Request) Validation missing for GithubActions Expressions #22

Open thehenrymcintosh opened 1 year ago

thehenrymcintosh commented 1 year ago

Feature Request

In GithubActions, this is a valid example of an expression:

concurrency:
  group: "${{ github.workflow }}"

and this is not, because of the missing closing bracket

concurrency:
  group: "${{ github.workflow }"

But this is not caught by the action-validator. Would it be possible to extend this to also check that expressions are valid?

mpalmer commented 1 year ago

Possible, yes. It would be a fair amount of work, though, as I doubt there's a Rust library that implements parsing+validation for the particular syntax used by GitHub, so that would need to be built.

I'm going to mark this as "PR welcome", as I think this would be a great addition to action-validator, but I don't have the inclination to do the work myself. After I've been bitten by a couple of syntax errors in expressions, I might change my mind, of course...

thehenrymcintosh commented 1 year ago

Ok, probably a bit outside my capacity at the moment to take on something like that, but would be a great addition I agree. Hopefully I'll get a window of time to take it on but unlikely to be soon, maybe when I get bitten by syntax errors I might change my mind too 😅

jamesbraza commented 9 months ago

Here's a similar permutation, where double quotes aren't allowed (GitHub docs for string):

env:
    A1: ${{ "invalid" }}
    A2: ${{ 'valid' }}