Skip to content

Commit 5b6b580

Browse files
feat: allow changing Docker image for scan job
Allows changing Docker image used for the scan job, this is useful if the Docker images should be pulled from a different place than the GitHub Container Registry. Such situations usually occur with air-gapped systems or places where Docker registry access is restricted.
1 parent d3459e6 commit 5b6b580

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -619,6 +619,8 @@ TruffleHog statically detects [https://canarytokens.org/](https://canarytokens.o
619619
base:
620620
# Scan commits until here (usually dev branch).
621621
head: # optional
622+
# Docker image to use for scanning, defaults to ghcr.io/trufflesecurity/trufflehog.
623+
image: # optional
622624
# Extra args to be passed to the trufflehog cli.
623625
extra_args: --log-level=2 --results=verified,unknown
624626
```

action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ inputs:
1818
default: ""
1919
description: Extra args to be passed to the trufflehog cli.
2020
required: false
21+
image:
22+
default: "ghcr.io/trufflesecurity/trufflehog"
23+
description: Docker image to use for scanning.
24+
required: false
2125
version:
2226
default: "latest"
2327
description: Scan with this trufflehog cli version.
@@ -36,6 +40,7 @@ runs:
3640
HEAD: ${{ inputs.head }}
3741
ARGS: ${{ inputs.extra_args }}
3842
COMMIT_IDS: ${{ toJson(github.event.commits.*.id) }}
43+
IMAGE: ${{ inputs.image }}
3944
VERSION: ${{ inputs.version }}
4045
run: |
4146
##########################################
@@ -94,7 +99,7 @@ runs:
9499
## Run TruffleHog ##
95100
##########################################
96101
docker run --rm -v .:/tmp -w /tmp \
97-
ghcr.io/trufflesecurity/trufflehog:${VERSION} \
102+
"${IMAGE}:${VERSION}" \
98103
git file:///tmp/ \
99104
--since-commit \
100105
${BASE:-''} \

0 commit comments

Comments
 (0)