Skip to content

Commit

Permalink
feat: Add a scanPath argument for TruffleHog (#153)
Browse files Browse the repository at this point in the history
* feat: Add a scanPath argument for TruffleHog

Makes this more configurable.  Helpful when checking out multipe
repositories and we can't make assumptions on the path.

* Removing comment
  • Loading branch information
Charles Sullivan authored May 3, 2021
1 parent f0e9f20 commit 527149a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 4 additions & 1 deletion trufflehog-actions-scan/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ inputs:
scanArguments:
description: 'Argument options for scan.'
required: false
scanPath:
description: 'Path to scan'
required: false
branding:
icon: 'shield'
color: 'yellow'
color: 'yellow'
10 changes: 8 additions & 2 deletions trufflehog-actions-scan/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@ if [ -n "${INPUT_SCANARGUMENTS}" ]; then
args="${INPUT_SCANARGUMENTS}" # Overwrite if new options string is provided
fi

githubRepo="file://$(pwd)" # Default target repository

if [ -n "${INPUT_SCANPATH}" ]; then
githubRepo="${INPUT_SCANPATH}"
fi

# By default the 'WORKDIR' of our Docker image is set to the 'GITHUB_WORKSPACE'
# which is mounted into our image. This means, as long as a checkout action was
# done before our action runs, we'll have access to the repository.
githubRepo="file://$(pwd)" # Default target repository

query="$args $githubRepo" # Build args query with repository url
trufflehog $query
trufflehog $query

0 comments on commit 527149a

Please sign in to comment.