Skip to content

Commit

Permalink
go/lint: allow exclusion from gitleaks
Browse files Browse the repository at this point in the history
  • Loading branch information
adamdecaf committed Sep 30, 2024
1 parent 8455ba5 commit e4d242d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion go/lint-project.sh
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,17 @@ if [[ "$run_gitleaks" == "true" ]]; then
mv gitleaks ./bin/gitleaks

echo "gitleaks version: "$(./bin/gitleaks version)
./bin/gitleaks detect --no-git --verbose

# Find directories and optionally exclude one
dirs=($(find . -mindepth 1 -type d | sort -u | grep -v ".git"))
if [ -n "$GITLEAKS_EXCLUDE" ]; then
dirs=($(echo "${dirs[@]}" | grep -v "$GITLEAKS_EXCLUDE"))
fi

for dir in "${dirs[@]}"; do
echo "Running gitleaks on $dir"
./bin/gitleaks detect --no-git --verbose --no-banner --source "$dir"
done
echo "FINISHED gitleaks check"
fi

Expand Down

0 comments on commit e4d242d

Please sign in to comment.