Commit 7746b2c
authored
Return non-zero exit code if an error occurs during a scan (#4476)
With its original code, Trufflehog was returning a zero exit code in
cases when an error was encountered during a scan. This led to some
unexpected situations, such as succeeding if a git repo was not cloned
correctly or if a non-existent commit was referenced from
`--since-commit`.
This commit adds a new flag `--fail-on-scan-errors` that, if
enabled, will propagate scan errors further (alongside with the current
behavior of reporting them on console), ensuring that Trufflehog returns
a non-zero exit code.
The change should be fairly safe, as it is hidden behind a flag and if
not activated, the original behavior is retained.
See also: #4218
Signed-off-by: Milan Plzik <[email protected]>1 parent 466da5b commit 7746b2c
1 file changed
+6
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
1081 | 1082 | | |
1082 | 1083 | | |
1083 | 1084 | | |
| 1085 | + | |
1084 | 1086 | | |
1085 | 1087 | | |
| 1088 | + | |
| 1089 | + | |
| 1090 | + | |
1086 | 1091 | | |
1087 | 1092 | | |
1088 | 1093 | | |
| |||
1099 | 1104 | | |
1100 | 1105 | | |
1101 | 1106 | | |
1102 | | - | |
| 1107 | + | |
1103 | 1108 | | |
1104 | 1109 | | |
1105 | 1110 | | |
| |||
0 commit comments