Skip to content

Find, verify, and analyze leaked credentials

Update github action to support generic cli command input (#670)

Jeff Wenzbauer4a3bba78ccc5
diff --git a/Dockerfile b/Dockerfile
index 8fc4eac6c..d84c78b72 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -12,5 +12,6 @@ FROM alpine:3.15
RUN apk add --no-cache git
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --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.yml
index 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: false
branding:
icon: "shield"
color: "green"
@@ -26,3 +30,4 @@ runs:
- --branch
- ${{ inputs.head }}
- --fail
+ - ${{ inputs.extra_args }}
diff --git a/entrypoint.sh b/entrypoint.sh
old mode 100644
new mode 100755
index 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