Need linter for GitHub Actions workflow's configuration

GitHub Actions is very nice service.

It could be very nice to check the configuration lint on the local machine.
Currently, it is not possible to know the configuration is correct syntax until workflow is executed.
So, I want to need a linter.
If you can publish the configuration schema, I will develop it.

Thanks

6 Likes

We’re working on linting and autocomplete for the GitHub web editor right now. The schema reference is in this doc, https://help.github.com/en/articles/workflow-syntax-for-github-actions.

1 Like

Thank you for working on linting and autocomplete.

Could you publish the schema in the way like json schema store ?
Then, engineers around the world can develop tools such as linters and IDE extensions.

2 Likes

We shipped a new editor for workflow files today that will hopefully resolve most of your issues https://github.blog/2019-10-01-new-workflow-editor-for-github-actions/.

6 Likes

This is great news! Very helpful, thanks!

However, I think it would be even more beneficial if the was a JSON schema available as requested by @homoluctus in post #3. Then we could build a validator in, say, VSCode. :wink:

11 Likes

Another vote for publishing a JSON schema. JetBrains IDEs (IntelliJ, PyCharm, WebStorm, etc.) all [support SchemaStore.org schema](https://www.jetbrains.com/help/idea/json.html#ws_json_using_schemas ““Using schemas from JSON Schema Store” in JetBrains docs”) validation. And many other CI/automation providers have published their schemas (Travis-CI, CircleCI, GitLab CI, etc.)

3 Likes

Visual Studio Code also has native support for JSON schemas, for YAML files to be validated with JSON schema the https://marketplace.visualstudio.com/items?itemName=redhat.vscode-yaml extension can add support for it.

Somebody has made the effort and created a schema. There is a pull request for GitHub workflow files and for action files.

[EDIT]

The Pull Request has already been merged. In my VSCode instance the linting is already successfully in place. Nice job!

6 Likes

hi, I’m using VSCode as well,

how did you enabled workflows/actions validation ??

1 Like

@mcosta74 You need to download the YAML extension for VSCode, as linked above by @csvn.

The extension will automatically pick up the JSON Schema for Github Actions & Workflows. I explain a little bit more in this short video.

This might be a better option https://marketplace.visualstudio.com/items?itemName=cschleiden.vscode-github-actions.