Find, verify, and analyze leaked credentials
Go credentialsdevsecopsdynamic-analysisprecommitscanningsecretsecret-managementsecretssecuritysecurity-toolstrufflehogverification
Update github action to support generic cli command input (#670)
Jeff Wenzbauer4a3bba78ccc5
diff --git a/Dockerfile b/Dockerfileindex 8fc4eac6c..d84c78b72 100644--- a/Dockerfile+++ b/Dockerfile@@ -12,5 +12,6 @@ FROM alpine:3.15RUN apk add --no-cache gitCOPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crtCOPY --from=builder /build/trufflehog /usr/bin/trufflehog-ENTRYPOINT ["/usr/bin/trufflehog"]-+COPY entrypoint.sh /etc/entrypoint.sh+RUN chmod +x /etc/entrypoint.sh+ENTRYPOINT ["/etc/entrypoint.sh"]diff --git a/action.yml b/action.ymlindex 080e10214..134308a20 100644--- a/action.yml+++ b/action.yml@@ -12,6 +12,10 @@ inputs:head:description: Scan commits until here (usually dev branch).required: false+ extra_args:+ default: ''+ description: Extra args to be passed to the trufflehog cli.+ required: falsebranding:icon: "shield"color: "green"@@ -26,3 +30,4 @@ runs:- --branch- ${{ inputs.head }}- --fail+ - ${{ inputs.extra_args }}diff --git a/entrypoint.sh b/entrypoint.shold mode 100644new mode 100755index 91f455a4b..4ef5e69bc--- a/entrypoint.sh+++ b/entrypoint.sh@@ -1,4 +1,5 @@-#! /usr/bin/env bash+#!/usr/bin/env ash-args=("$@")-/usr/bin/trufflehog ${args[@]}\ No newline at end of file+# `$*` expands the `args` supplied in an `array` individually+# or splits `args` in a string separated by whitespace.+/usr/bin/trufflehog $*\ No newline at end of file