Add MegaLinter for JSON and GitHub Workflow files #572
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
MegaLinter
MegaLinter is an aggregate linter that combines a huge collection of different language/format linters and consolidates their configs. It's a hard fork of SuperLinter, but I prefer MegaLinter's approach to documentation and security more than SuperLinter. If you are unfamiliar with either of these aggregate linters, you can check out MegaLinter's website (https://megalinter.io/latest/).
This PR enables linting for GitHub actions and static JSON from MegaLinter.
JSON
Lints JSON files to make sure we aren't checking in malformed configurations/settings files. Reports are served as a pull request comment and inline on the file viewer for the PR. The JSON linter has auto-fixing disabled and is set to only emit errors. JSON linting only occurs on JSON files that change within the PR being evaluated. Example below:
GitHub Actions
Lints GitHub actions yml/yaml for correct syntax and reports errors that would typically silently fail or not behave as expected. This helps cut down on the amount of iterations needed to test GitHub actions and ensures that our workflows remain robust and stable. GitHub workflow linting will evaluate on ALL workflow files when one or more is changed. This is because workflows can cross reference each other and we want to ensure that we aren't breaking workflows not involved in the pull request. Example below:
Pull Request reporting
MegaLinter automatically adds a report to the PR comments with links to the relevant logs so devs can easily identify where the problems are. Linting is configured to run whenever a PR is created or updated.
Future Extensibility
MegaLinter already has out of the box support for the following use cases that are relevant to us: