Describe the bug
When using MegaLinter in a GitLab CI Merge Request pipeline with VALIDATE_ALL_CODEBASE: "false", the engine fails to detect any changed files.
The Updated Sources Reporter outputs No source file has been formatted or fixed and skips all file validations. This happens because MegaLinter's underlying Python process executes a bare workspace diff (git diff --abbrev=40 --full-index -M --raw -z --no-color), which returns zero results in environments using clean detached HEAD checkouts (like GitLab Runner)
To Reproduce
Steps to reproduce the behavior:
- Create a GitLab CI pipeline targeted at a Merge Request event ($CI_PIPELINE_SOURCE == "merge_request_event").
- Set VALIDATE_ALL_CODEBASE: "false" and GIT_DEPTH: 0.
- Push changes to a feature branch and open a Merge Request.
- Observe the MegaLinter log. It will state that 0 files were updated/found despite active file differences existing between the source and target branch
Logs from job:
Start updated Sources Reporter
sys.platform='linux', git_executable='git'
Popen(['git', 'diff', '--abbrev=40', '--full-index', '-M', '--raw', '-z', '--no-color'], cwd=/builds/..., stdin=None, shell=False, universal_newlines=False)
Updated files :
[Updated Sources Reporter] No source file has been formatted or fixed
Expected behavior
Expect to see the new/modified files in the Updated files output and associated linters to run.
Describe the bug
When using MegaLinter in a GitLab CI Merge Request pipeline with VALIDATE_ALL_CODEBASE: "false", the engine fails to detect any changed files.
The Updated Sources Reporter outputs No source file has been formatted or fixed and skips all file validations. This happens because MegaLinter's underlying Python process executes a bare workspace diff (git diff --abbrev=40 --full-index -M --raw -z --no-color), which returns zero results in environments using clean detached HEAD checkouts (like GitLab Runner)
To Reproduce
Steps to reproduce the behavior:
Logs from job:
Start updated Sources Reporter
sys.platform='linux', git_executable='git'
Popen(['git', 'diff', '--abbrev=40', '--full-index', '-M', '--raw', '-z', '--no-color'], cwd=/builds/..., stdin=None, shell=False, universal_newlines=False)
Updated files :
[Updated Sources Reporter] No source file has been formatted or fixed
Expected behavior
Expect to see the new/modified files in the Updated files output and associated linters to run.