Skip to content

Commit

Permalink
Fix listing of modified files (#3472)
Browse files Browse the repository at this point in the history
  • Loading branch information
vkucera authored Apr 16, 2024
1 parent 1a7ea8c commit 85c5718
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
3 changes: 2 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -1452,6 +1452,7 @@
"vison",
"visualforce",
"vitalitytv",
"vkucera",
"votre",
"vrefwarning",
"vsiakka",
Expand Down Expand Up @@ -1489,4 +1490,4 @@
"zaach",
"zricethezav"
]
}
}
2 changes: 2 additions & 0 deletions .github/workflows/deploy-DEV.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ jobs:
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0

# Free disk space
- name: Free Disk space
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ Note: Can be used with `oxsecurity/megalinter@beta` in your GitHub Action mega-l
- Add ruff sarif support

- Fixes
- Fix listing of modified files, by @vkucera in <https://github.com/oxsecurity/megalinter/pull/3472>. Fixes <https://github.com/oxsecurity/megalinter/issues/2125>.
- 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
Expand Down
4 changes: 2 additions & 2 deletions megalinter/MegaLinter.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down

0 comments on commit 85c5718

Please sign in to comment.