-
Notifications
You must be signed in to change notification settings - Fork 40
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
Validate usage of double quotes in expressions #151
Comments
Hello, for completeness, we run the check with the build-in config:
|
Hi, thanks for the issue report! The built-in schema is just a vendored copy of schemastore's github-workflows schema. So I think one appropriate fix here is to update that schema to forbid the use of bare double-quotes inside of expressions. I haven't looked yet, but I would be a little surprised if this is an easy change in that schema. You could add a second schema which you use to do this validation (e.g. hard reject I would also be open in theory to adding bespoke validation for GitHub expressions, but I currently don't have a lot of flex in my schedule to work on this. I'll continue to noodle on this and what appropriate fixes are possible. |
Thank you for the reply. Completely understandable! I will forward your suggestions to my colleagues who can decide what to do. Afaik, this would be a nice-to-have for us, but not a priority item. We just wanted to raise this idea in case others can benefit from it 😃 |
Motivation
We use check-jsonschema in https://github.com/Lightning-AI/lightning/ to validate all our workflow files and it works very well. We have a GitHub action for this check here.
Recently we debugged an issue in our configuration that wasn't caught by check-jsonschema. The following yaml had double quotes in the expression:
which caused an error in the workflow:
And it should have used single quotes like this:
check-jsonschema is useful for us because we can raise these warnings directly to the author in the PR.
Pitch
Would it be possible to have check-jsonschema validate against correct usage of single quotes vs. double quotes? I am not familiar with how check-jsonschema works, whether this is technically possible, or whether this is in the scope of this tool at all.
The text was updated successfully, but these errors were encountered: