Files
trufflehog/scripts/test-last-changed-detector.sh
Dustin Decker 972108aea4
Dogfood / test (1.17.x, ubuntu-latest) (push) Waiting to run
Lint / lint (push) Waiting to run
Release / Release (push) Waiting to run
Snifftest / Run Snifftest (push) Waiting to run
Test / test (1.17.x, ubuntu-latest) (push) Waiting to run
Test / test-detectors (1.17.x, ubuntu-latest) (push) Waiting to run
21 new detectors (#347)
2022-04-08 16:07:39 -07:00

18 lines
462 B
Bash
Executable File

#!/bin/bash
set -uo pipefail
CHANGED=$(git diff --name-only --no-commit-id origin/main | grep pkg/detectors | grep -v test)
while IFS= read -r FILE; do
DIRECTORY=$(basename $FILE ".go")
if [ -d "pkg/detectors/$DIRECTORY" ]
then
echo $DIRECTORY
go test -v "github.com/trufflesecurity/trufflehog/v3/pkg/detectors/$DIRECTORY"
retVal=$?
if [ $retVal -ne 0 ]; then
exit 1
fi
fi
done <<< "$CHANGED"