asyncapi / .github

Location of all reusable community health files
29 stars 62 forks source link

Evaluate github.com/rhysd/actionlint for linting GH Actions workflow files #257

Open smoya opened 10 months ago

smoya commented 10 months ago

Reason/Context

At this moment, we run the following validation action that runs on each PR and validates GH Action workflow files by validating the schema against the following JSON Schema file. That validation is very basic but still useful for catching very basic typos and errors.

However, yesterday I discovered https://github.com/rhysd/actionlint, a static linter for GitHub Actions workflow files.

The list of checks is massive, and I feel most of those are useful for our actions. For example, checking variables, syntax and type checking for ${{}} expressions, dispatch events usage validation, shellcheck integration for commands in run, dependencies validation, input checks for reusable workflows, besides others.

I believe we could switch completely the action we use now in favor of this one and improve validation of GH Actions workflow files. This will help developers to develop new workflow files or modify existing ones without the concern of pushing changes with wrong content.

Description

Test https://github.com/rhysd/actionlint against some repo first, and see if it catches issues. I expect the linter will catch some errors on existing workflow files.

If we find those, it will mean the action is completely needed so I would recommend to include it in our pipelines. In the other hand, if doesn't find errors, to decide if we want to switch or rather keep the simple validation we have now.


For code owners, please consider this as a good-first-issue @derberg @alequetzalli @fmvilas @KhudaDad414

mhmohona commented 5 months ago

Hey @smoya, I would like to work on this.

smoya commented 5 months ago

Hey @smoya, I would like to work on this.

Of course! Feel free to submit your PR.

Thank you!