From 34428c0cdf11138ecfeac825f8d8801caa1596ae Mon Sep 17 00:00:00 2001 From: Ole Langbehn <ole.langbehn@inoio.de> Date: Thu, 27 Jul 2023 20:07:41 +0200 Subject: [PATCH] HOLI-3873 automated secret leakage detection via gitleaks pre-commit hook --- .envrc | 4 ++++ .husky/pre-commit | 4 ++++ 2 files changed, 8 insertions(+) create mode 100755 .husky/pre-commit diff --git a/.envrc b/.envrc index 6a113c5..4f0af3a 100644 --- a/.envrc +++ b/.envrc @@ -1,3 +1,5 @@ +#!/bin/sh + if [ ! -f ".envrc.local" ]; then cp .envrc.local.template .envrc.local echo ".envrc.local was created from template, please add your credentials and customize to your environment" @@ -6,3 +8,5 @@ fi # loads personal (secret) data from separate env file (not checked in) source_env_if_exists .envrc.local +type yarn >/dev/null 2>&1 && PATH="$PATH:$(yarn global bin)" +export PATH \ No newline at end of file diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000..c1d6996 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/bin/sh +. "$(dirname "$0")/_/husky.sh" + +gitleaks protect --staged -v -c ../.gitleaks.toml -- GitLab