github-actionssuper-linter

super-linter cannot find submodule for linting


Working with super-linter in a GitHub Actions workflow, this is a portion of it:

- name: Clone repository
  uses: actions/checkout@v4
  with:
    submodules: recursive
    fetch-depth: 0

- name: Super-linter
  uses: super-linter/super-linter@v5.7.2
  env:
    DEFAULT_BRANCH: develop
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

The submodule is downloaded successfully to folder src/components but super-linter cannot find it:

2024-01-19 15:56:20 [INFO]   Gathering user validation information...
2024-01-19 15:56:20 [INFO]   - Validating ALL files in code base...
2024-01-19 15:56:25 [INFO]   ---------------------------------
2024-01-19 15:56:25 [INFO]   ------ File list to check: ------
2024-01-19 15:56:25 [INFO]   ---------------------------------
2024-01-19 15:56:27 [WARN]   File:{/github/workspace/src/components} existed in commit data, but not found on file system, skipping...
2024-01-19 15:56:29 [INFO]   ----------------------------------------------
2024-01-19 15:56:29 [INFO]   Successfully gathered list of files...

super-linter scans only the parent repo without the submodule.

Any help with this issue? Thank you!


Solution

  • You can set USE_FIND_ALGORITHM to true which is false by default to lint all the files.

    According to USE_FIND_ALGORITHM:

    By default, we use git diff to find all files in the workspace and what has been updated, this would enable the Linux find method instead to find all files to lint

    That is what you've been observing i.e. only the updated files are linted. Switching to find with this will include everything and that is what you're looking for.