GitGuardian / ggshield

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

Handle IAC scans on CI after force pushing #837

Closed carla-gitguardian closed 8 months ago

carla-gitguardian commented 8 months ago

This MR intends to fix the behaviour of CI jobs after a forced push, on both IAC and SCA scans.

It used to trigger an error, trying to access a commit from before the history was rewritten.

This situation will now trigger a scan on all commits instead.

codecov-commenter commented 8 months ago

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (801194f) 91.93% compared to head (db8e6ed) 91.69%.

Files Patch % Lines
ggshield/core/git_hooks/ci/previous_commit.py 88.23% 2 Missing :warning:
ggshield/cmd/iac/scan/diff.py 0.00% 1 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## pbes/fix-prepush-new-branch-github #837 +/- ## ====================================================================== - Coverage 91.93% 91.69% -0.24% ====================================================================== Files 168 168 Lines 6952 6962 +10 ====================================================================== - Hits 6391 6384 -7 - Misses 561 578 +17 ``` | [Flag](https://app.codecov.io/gh/GitGuardian/ggshield/pull/837/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/837/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GitGuardian) | `91.69% <83.33%> (-0.24%)` | :arrow_down: | 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.