Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(Feature Request) Validation missing for GithubActions Expressions #22

Open
thehenrymcintosh opened this issue Jan 9, 2023 · 3 comments
Labels
pr-welcome This would be a good fix/feature, but the maintainer isn't planning on doing the work

Comments

@thehenrymcintosh
Copy link

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 mpalmer added the pr-welcome This would be a good fix/feature, but the maintainer isn't planning on doing the work label Jan 9, 2023
@mpalmer
Copy link
Owner

mpalmer commented Jan 9, 2023

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
Copy link
Author

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
Copy link

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-welcome This would be a good fix/feature, but the maintainer isn't planning on doing the work
Projects
None yet
Development

No branches or pull requests

3 participants