mpalmer / action-validator

Tool to validate GitHub Action and Workflow YAML files

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

(Feature Request) Validation missing for GithubActions Expressions

thehenrymcintosh opened this issue · comments

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?

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...

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 😅

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

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