Skip to content

Commit e194d8f

Browse files
committed
Adding in explicit no_fail input and check
1 parent 55b2dc0 commit e194d8f

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

action.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ inputs:
1414
head:
1515
description: Scan commits until here (usually dev branch).
1616
required: false
17+
no_fail:
18+
description: When set, trufflehog does not exit with a 183 code when a credential is found.
19+
required: false
20+
default: ''
1721
extra_args:
1822
default: ""
1923
description: Extra args to be passed to the trufflehog cli.
@@ -34,6 +38,7 @@ runs:
3438
using: "composite"
3539
steps:
3640
- shell: bash
41+
id: trufflehog
3742
working-directory: ${{ inputs.path }}
3843
env:
3944
BASE: ${{ inputs.base }}
@@ -96,6 +101,14 @@ runs:
96101
fi
97102
fi
98103
##########################################
104+
## Determine additional args ##
105+
##########################################
106+
if [ -n "$NO_FAIL" ]; then
107+
FAIL=""
108+
else
109+
FAIL="--fail"
110+
fi
111+
##########################################
99112
## Run TruffleHog ##
100113
##########################################
101114
results=$(docker run --rm -v ${{ github.workspace }}:/tmp -w /tmp \
@@ -105,6 +118,7 @@ runs:
105118
${BASE:-''} \
106119
--branch \
107120
${HEAD:-''} \
121+
${FAIL} \
108122
--no-update \
109123
--github-actions \
110124
${ARGS:-''})

0 commit comments

Comments
 (0)