GitGuardian / ggshield

Find and fix 400+ types of hardcoded secrets and 70+ types of infrastructure-as-code misconfigurations.
https://gitguardian.com
MIT License
1.68k stars 150 forks source link

Change behavior of `secret scan pre-commit` on merge commits #962

Closed agateau-gg closed 1 month ago

agateau-gg commented 1 month ago

Context

Since #957, secret scan ci no longer scans non-conflicting files when scanning a merge commit. This PR changes the behavior of secret scan pre-commit to do the same, making the behavior more consistent.

What has been done

Rename --skip-unchanged-merge-files to --scan-all-merge-files, invert its behavior in the code. Adjust the tests and the changelog entry.

Validation

Tests still pass.

PR check list

codecov[bot] commented 1 month ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 91.71%. Comparing base (e6233bd) to head (9c183d0). Report is 2 commits behind head on main.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #962 +/- ## ======================================= Coverage 91.71% 91.71% ======================================= Files 178 178 Lines 7431 7431 ======================================= Hits 6815 6815 Misses 616 616 ``` | [Flag](https://app.codecov.io/gh/GitGuardian/ggshield/pull/962/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GitGuardian) | Coverage Δ | | |---|---|---| | [unittests](https://app.codecov.io/gh/GitGuardian/ggshield/pull/962/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GitGuardian) | `91.71% <ø> (ø)` | | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GitGuardian#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.