I am currently using the MegaLinter GitHub Action in my CI workflow to lint various file types, including YAML files. The YAML linter seems to be initiated correctly as part of the MegaLinter setup, but I'm encountering an issue where it is unable to detect files in the Git repository. The MegaLinter output indicates that it cannot list git ignored files and, consequently, keeps zero files.
Here is a snippet of the relevant part in my GitHub Action workflow:
action.yml
name: Run CI Light Linters
on:
push:
branches:
- main
jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Run CI Light Linters
id: Mega-Linters
if: ${{ inputs.ENABLE_LINTERS == '' }}
uses: oxsecurity/megalinter/flavors/ci_light@fda6ac3a38be0e969820709ac16e442464e5a035
with:
# other configuration options...
ENABLE_LINTERS: "YAML_PRETTIER"
env:
VALIDATE_ALL_CODEBASE: true
continue-on-error: true
MegaLinter Output
Here is the relevant output from MegaLinter:
> MegaLinter now collects the files to analyse (expand for details)
Listing all files in directory [/github/workspace], then filter with:
>
> - File extensions: .yaml, .yml Unable to list git ignored files (/github/workspace) Kept [0] files on [0] found files
>
> +----MATCHING LINTERS-+----------+----------------+------------+ | Descriptor | Linter | Criteria | Matching files | Format/Fix |
> +------------+--------+----------+----------------+------------+
>
> +----SUMMARY-+--------+------+-------+-------+--------+--------------+ | Descriptor | Linter | Mode | Files | Fixed | Errors | Elapsed time |
> +------------+--------+------+-------+-------+--------+--------------+
>
> Unable to find git repository to list updated files [Updated Sources
> Reporter] No source file has been formatted or fixed ✅ Successfully
> linted all files without errors
What am I missing?