Skip to content

feat: allow changing Docker image for scan job #4242

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,8 @@ TruffleHog statically detects [https://canarytokens.org/](https://canarytokens.o
base:
# Scan commits until here (usually dev branch).
head: # optional
# Docker image to use for scanning, defaults to ghcr.io/trufflesecurity/trufflehog.
image: # optional
# Extra args to be passed to the trufflehog cli.
extra_args: --log-level=2 --results=verified,unknown
```
Expand Down
7 changes: 6 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ inputs:
default: ""
description: Extra args to be passed to the trufflehog cli.
required: false
image:
default: "ghcr.io/trufflesecurity/trufflehog"
description: Docker image to use for scanning.
required: false
version:
default: "latest"
description: Scan with this trufflehog cli version.
Expand All @@ -36,6 +40,7 @@ runs:
HEAD: ${{ inputs.head }}
ARGS: ${{ inputs.extra_args }}
COMMIT_IDS: ${{ toJson(github.event.commits.*.id) }}
IMAGE: ${{ inputs.image }}
VERSION: ${{ inputs.version }}
run: |
##########################################
Expand Down Expand Up @@ -94,7 +99,7 @@ runs:
## Run TruffleHog ##
##########################################
docker run --rm -v .:/tmp -w /tmp \
ghcr.io/trufflesecurity/trufflehog:${VERSION} \
"${IMAGE}:${VERSION}" \
git file:///tmp/ \
--since-commit \
${BASE:-''} \
Expand Down