Skip to content

Commit 4712051

Browse files
authored
Replace trivy fs scan with trivy secret scan
1 parent a0213a1 commit 4712051

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

.pre-commit-config.yaml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,17 @@ repos:
5050
# =========================================
5151
- repo: local
5252
hooks:
53-
- id: trivy-fs
54-
name: trivy fs scan
55-
entry: bash -c 'TRIVY_CACHE_DIR=${TRIVY_CACHE_DIR:-$HOME/.cache/trivy} trivy fs --scanners vuln,secret,misconfig --severity HIGH,CRITICAL --exit-code 1 .'
53+
- id: trivy-secret-scan
54+
name: trivy-secret-scan
55+
entry: bash
56+
args:
57+
- -c
58+
- |
59+
if [ "$GITHUB_ACTIONS" = "true" ]; then
60+
echo "Skipping Trivy in CI"
61+
exit 0
62+
else
63+
trivy fs --scanners secret --skip-dirs .git --skip-dirs vendor --exit-code 1 --no-progress .
64+
fi
5665
language: system
57-
pass_filenames: false
66+
pass_filenames: false

0 commit comments

Comments
 (0)