Reputation: 501
GitLab has a tool, CI Lint, which can be used to validate and check CI/CD syntax for GitLab Pipelines.
Does GitHub have an equivalent tool for GitHub Actions?
I have searched but cannot find any equivalent so far...
Upvotes: 4
Views: 936
Reputation: 501
FYI as of 28th March 2023 checking syntax for GitHub Actions can now be done via the GitHub Actions VS Code extension.
Quoting from the announcement blog post:
Validation and code completion for the YAML schema and GitHub Actions Expressions. Get instant validation and code completion for the workflow schema, expression functions, event payloads, and job or step outputs.
Upvotes: 1
Reputation: 93
A bit of this is mentioned as a comment on your initial question, but I personally use the following:
When building my pipeline I use the yaml extension provided by RedHat
for VSCode. This uses the JSON Schema store to validate the yaml
syntax used by GitHub Actions.
My repositories us the GitHub provided super-linter action available on the marketplace to lint my github actions files. This includes a basic yaml linter, but also actionlint (as mentioned in the comments above) which would apply to your github workflows. These can be ran locally, but I tend to rely on the intellisense within VSCode locally, and the linters within GitHub.
Upvotes: 5