DROID-1065 Project | Tech | Add secrets push hook (#3041)

This commit is contained in:
Mikhail 2023-03-29 17:58:24 +03:00 committed by GitHub
parent f35ba08050
commit 9ff2400d76
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 0 deletions

17
.githooks/pre-push Executable file
View File

@ -0,0 +1,17 @@
#!/usr/bin/env bash
INSTALL_PYTHON=python3
ARGS=(hook-impl --config=.pre-commit-config.yaml --hook-type=pre-push)
# end templated
HERE="$(cd "$(dirname "$0")" && pwd)"
ARGS+=(--hook-dir "$HERE" -- "$@")
if [ -x "$INSTALL_PYTHON" ]; then
exec "$INSTALL_PYTHON" -mpre_commit "${ARGS[@]}"
elif command -v pre-commit > /dev/null; then
exec pre-commit "${ARGS[@]}"
else
echo '`pre-commit` not found. Please visit https://wiki.anytype.io/doc/mandatory-git-hooks-5rQt1Qyw7k ' 1>&2
exit 1
fi

5
.pre-commit-config.yaml Normal file
View File

@ -0,0 +1,5 @@
repos:
- repo: https://github.com/zricethezav/gitleaks
rev: v8.16.0
hooks:
- id: gitleaks