Don't call get_pr_data if GitLeaks linter is not active#4469
Merged
Conversation
Contributor
🦙 MegaLinter status:
|
| Descriptor | Linter | Files | Fixed | Errors | Elapsed time |
|---|---|---|---|---|---|
| ✅ API | spectral | 1 | 0 | 1.77s | |
| bash-exec | 6 | 1 | 0.02s | ||
| ✅ BASH | shellcheck | 6 | 0 | 0.21s | |
| ✅ BASH | shfmt | 6 | 0 | 0 | 0.84s |
| ✅ COPYPASTE | jscpd | yes | no | 3.4s | |
| ✅ DOCKERFILE | hadolint | 129 | 0 | 23.87s | |
| ✅ JSON | jsonlint | 20 | 0 | 0.25s | |
| ✅ JSON | v8r | 22 | 0 | 16.49s | |
| markdownlint | 267 | 0 | 301 | 27.93s | |
| ✅ MARKDOWN | markdown-table-formatter | 267 | 0 | 0 | 159.85s |
| bandit | 214 | 66 | 3.5s | ||
| ✅ PYTHON | black | 214 | 0 | 0 | 5.49s |
| ✅ PYTHON | flake8 | 214 | 0 | 2.05s | |
| ✅ PYTHON | isort | 214 | 0 | 0 | 1.18s |
| ✅ PYTHON | mypy | 214 | 0 | 18.58s | |
| ✅ PYTHON | pylint | 214 | 0 | 34.22s | |
| ✅ PYTHON | ruff | 214 | 0 | 0 | 0.78s |
| ✅ REPOSITORY | checkov | yes | no | 36.44s | |
| ✅ REPOSITORY | git_diff | yes | no | 1.32s | |
| grype | yes | 26 | 15.61s | ||
| ✅ REPOSITORY | secretlint | yes | no | 11.82s | |
| ✅ REPOSITORY | trivy | yes | no | 16.51s | |
| ✅ REPOSITORY | trivy-sbom | yes | no | 0.28s | |
| trufflehog | yes | 1 | 53.21s | ||
| ✅ SPELL | cspell | 717 | 0 | 13.97s | |
| lychee | 349 | 13 | 6.05s | ||
| ✅ XML | xmllint | 3 | 0 | 0 | 0.81s |
| ✅ YAML | prettier | 160 | 0 | 0 | 5.03s |
| ✅ YAML | v8r | 102 | 0 | 34.04s | |
| ✅ YAML | yamllint | 161 | 0 | 2.98s |
See detailed report in MegaLinter reports
nvuillam
approved these changes
Jan 9, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
If you have
REPOSITORY_GITLEAKS_PR_COMMITS_SCAN: truebut the linter is not enabled it will fail:https://github.com/oxsecurity/megalinter/blob/2402a653f4d13b4a4be7b0ab2df3b5b9fa325d7e/megalinter/linters/GitleaksLinter.py
This happens because if the linter is not active, the
workspacevariable is not assigned:megalinter/megalinter/Linter.py
Line 274 in 2402a65
I therefore propose that you do nothing if it is deactivated.