Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix listing of modified files #3472

Merged
merged 5 commits into from
Apr 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
echoix marked this conversation as resolved.
Show resolved Hide resolved

# 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 @@ -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 <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