mirror of
https://github.com/drone/drone-kaniko.git
synced 2026-06-04 10:14:54 +08:00
20525e5403
* feat: [CI-10849]: add git-leaks support * correct reference
17 lines
675 B
Bash
17 lines
675 B
Bash
#!/bin/bash
|
|
|
|
#Helper script to be used as a pre-commit hook.
|
|
|
|
echo "This hook checks for any secrets getting pushed as part of commit. If you feel that scan is false positive. \
|
|
Then add the exclusion in .gitleaksignore file. For more info visit: https://github.com/zricethezav/gitleaks"
|
|
|
|
GIT_LEAKS_PRE_COMMIT=s$(git config --bool hook.pre-commit.gitleak)
|
|
|
|
echo "INFO: Scanning Commits information for any GIT LEAKS"
|
|
gitleaks protect --staged -v --exit-code=100
|
|
STATUS=$?
|
|
if [ $STATUS = 100 ]; then
|
|
echo "WARNING: GIT LEAKS has detected sensitive information in your changes. Please remove them or add them (IF NON-SENSITIVE) in .gitleaksignore file."
|
|
else
|
|
exit 0
|
|
fi |