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

* Update github action to support generic cli command input

* revert removal of inputs

* echo in entrypoint

* test custom docker image

* revert docker image reference
This commit is contained in:
Jeff Wenzbauer 2022-08-01 16:05:08 -06:00 committed by GitHub
parent dc516933f3
commit 4a3bba78cc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 5 deletions

View file

@ -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"]

View file

@ -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 }}

7
entrypoint.sh Normal file → Executable file
View file

@ -1,4 +1,5 @@
#! /usr/bin/env bash
#!/usr/bin/env ash
args=("$@")
/usr/bin/trufflehog ${args[@]}
# `$*` expands the `args` supplied in an `array` individually
# or splits `args` in a string separated by whitespace.
/usr/bin/trufflehog $*