mega-linter-runner: Run MegaLinter Locally and in CI
mega-linter-runner launches MegaLinter in a Docker container to run dozens of linters at once, including actionlint and yamllint for CI config, across your repo.
Instead of wiring each linter separately, MegaLinter bundles them and applies the right ones per file type. mega-linter-runner is the local wrapper; in CI you usually use the MegaLinter action or image directly.
What it does
mega-linter-runner pulls a MegaLinter flavor image and runs it against the working directory. MegaLinter detects languages and runs matching linters (including actionlint for workflows and yamllint for YAML), aggregating results into reports and an optional SARIF file.
Common usage
npx mega-linter-runner
npx mega-linter-runner --flavor ci_light
npx mega-linter-runner --fix # apply auto-fixes
npx mega-linter-runner -e 'ENABLE=YAML,ACTION'Options
| Flag | What it does |
|---|---|
| --flavor <name> | Use a smaller flavor image, e.g. ci_light |
| --fix | Enable auto-fixing where linters support it |
| -e, --env <KEY=val> | Pass MegaLinter env vars such as ENABLE or DISABLE |
| --release <tag> | Pin the MegaLinter image version |
| --path <dir> | Directory to lint |
In CI
In CI, prefer the official MegaLinter GitHub Action or the Docker image over the runner. Pin the image version and enable only the linters you need (via ENABLE) so runs stay fast. It complements dedicated tools like zizmor rather than replacing them.
Common errors in CI
Cannot connect to the Docker daemon means Docker is unavailable (mega-linter-runner needs Docker). A failing run ends with MegaLinter has found X errors and lists each linter's findings. MEGALINTER: found ... error(s) fails the job. Using the full image when you only need a couple of linters is the usual cause of slow CI; switch flavors.