Skip to content

Commit

Permalink
Update github action to support generic cli command input (#670)
Browse files Browse the repository at this point in the history
* Update github action to support generic cli command input

* revert removal of inputs

* echo in entrypoint

* test custom docker image

* revert docker image reference
  • Loading branch information
Jeff Wenzbauer authored Aug 1, 2022
1 parent dc51693 commit 4a3bba7
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
5 changes: 5 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -26,3 +30,4 @@ runs:
- --branch
- ${{ inputs.head }}
- --fail
- ${{ inputs.extra_args }}
7 changes: 4 additions & 3 deletions entrypoint.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -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 $*

0 comments on commit 4a3bba7

Please sign in to comment.