From 7ad81a1ec16cd5976eca5721b3e29f2b074a3a52 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 5 Apr 2024 22:30:43 +0200 Subject: [PATCH 1/4] Fix listing of modified files Consider the merge-base commit as the starting point of diff instead of listing all differences between branches. --- megalinter/MegaLinter.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/megalinter/MegaLinter.py b/megalinter/MegaLinter.py index a7106152dd4..93e5e9ed0f8 100644 --- a/megalinter/MegaLinter.py +++ b/megalinter/MegaLinter.py @@ -773,10 +773,10 @@ def list_files_git_diff(self): "HEAD" if default_branch == "HEAD" else f"refs/heads/{default_branch}" ) local_ref = f"refs/remotes/{default_branch_remote}" - # Try to fetch default_branch from origin, because it'sn't cached locally. + # Try to fetch default_branch from origin, because it isn't cached locally. repo.git.fetch("origin", f"{remote_ref}:{local_ref}") # Make git diff to list files (and exclude symlinks) - diff = repo.git.diff(default_branch_remote, name_only=True) + diff = repo.git.diff(f"{default_branch_remote}...", name_only=True) logging.info(f"Modified files:\n{diff}") all_files = list() for diff_line in diff.splitlines(): From a9621ea0e06d52cc63b3733d4b9a882372df5c33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Fri, 5 Apr 2024 23:33:20 +0200 Subject: [PATCH 2/4] Update changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b361e00767..f74014a2859 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l - New linters - Fixes + - Fix listing of modified files, by @vkucera in . Fixes . - Fix clang-format documentation links to point to the correct version. Fixes [#3452](https://github.com/oxsecurity/megalinter/issues/3452) - Fix conflict between prettier and yamllint about spaces - Ensure [trufflehog](https://github.com/trufflesecurity/trufflehog) does not auto-update itself From 5e1adaca3495dbb284da718e8ac6e0b2ccc38c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Sat, 6 Apr 2024 00:00:14 +0200 Subject: [PATCH 3/4] Add user name in dictionary --- .cspell.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.cspell.json b/.cspell.json index f338a31db2a..01d64052506 100644 --- a/.cspell.json +++ b/.cspell.json @@ -1452,6 +1452,7 @@ "vison", "visualforce", "vitalitytv", + "vkucera", "votre", "vrefwarning", "vsiakka", @@ -1489,4 +1490,4 @@ "zaach", "zricethezav" ] -} \ No newline at end of file +} From 23ae3c0314959f15e0e260f647fa0d8eae399732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ku=C4=8Dera?= Date: Sat, 6 Apr 2024 00:52:20 +0200 Subject: [PATCH 4/4] Fix fetch level in deploy-DEV --- .github/workflows/deploy-DEV.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/deploy-DEV.yml b/.github/workflows/deploy-DEV.yml index a501c0ea164..7db6797caed 100644 --- a/.github/workflows/deploy-DEV.yml +++ b/.github/workflows/deploy-DEV.yml @@ -63,6 +63,8 @@ jobs: steps: - name: Checkout Code uses: actions/checkout@v4 + with: + fetch-depth: 0 # Free disk space - name: Free Disk space