-
-
Notifications
You must be signed in to change notification settings - Fork 293
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
Scan only PR commits for Gitleaks instead of whole codebase, when VALIDATE_ALL_CODEBASE is set to false
Describe the solution you'd like
When VALIDATE_ALL_CODEBASE is set to false, and megalinter runs on PR then Gitleaks scans only PR commits.
Describe alternatives you've considered
Described scenarios is achievable by passing REPOSITORY_GITLEAKS_ARGUMENTS env contains gitleaks flag --log-opts, but nice to have out-of-the-box support (using VALIDATE_ALL_CODEBASE) without extra configuration.
- name: MegaLinter
if: ${{ github.event_name == 'pull_request' }}
id: megalinter
uses: oxsecurity/megalinter/flavors/documentation@v6
env:
VALIDATE_ALL_CODEBASE: false
REPOSITORY_GITLEAKS_ARGUMENTS: --log-opts '--no-merges --first-parent ${{ github.event.pull_request.base.sha }}^..${{ github.event.pull_request.head.sha }}'Downside - to scan only PR commits with proposed gitleaks config, git checkout has to be set with fetch-depth: 0
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0Additional context
N/A
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request