Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Make the github action work with a path as input (#2908)
Ben Bridtsf122b295bf4d
diff --git a/action.yml b/action.ymlindex 544877ca0..da93288a6 100644--- a/action.yml+++ b/action.yml@@ -30,8 +30,8 @@ runs:using: "composite"steps:- shell: bash+ working-directory: ${{ inputs.path }}env:- REPO_PATH: ${{ inputs.path }}BASE: ${{ inputs.base }}HEAD: ${{ inputs.head }}ARGS: ${{ inputs.extra_args }}@@ -43,6 +43,7 @@ runs:## Scan by BASE & HEAD user inputs #### If BASE == HEAD, exit with error ############################################+ git status >/dev/null # make sure we are in a git repostioryif [ -n "$BASE" ] || [ -n "$HEAD" ]; thenif [ -n "$BASE" ]; thenbase_commit=$(git rev-parse "$BASE" 2>/dev/null) || true@@ -54,7 +55,7 @@ runs:elsehead_commit=""fi- if [ $base_commit == $head_commit ] ; then+ if [ "$base_commit" == "$head_commit" ] ; thenecho "::error::BASE and HEAD commits are the same. TruffleHog won't scan anything. Please see documentation (https://github.com/trufflesecurity/trufflehog#octocat-trufflehog-github-action)."exit 1fi@@ -85,7 +86,7 @@ runs:############################################ Run TruffleHog ############################################- docker run --rm -v "$REPO_PATH":/tmp -w /tmp \+ docker run --rm -v .:/tmp -w /tmp \ghcr.io/trufflesecurity/trufflehog:${VERSION} \git file:///tmp/ \--since-commit \