Skip to content

Commit

Permalink
Adding input_fail option to this github action
Browse files Browse the repository at this point in the history
  • Loading branch information
sttor authored May 10, 2022
1 parent bd98280 commit 8286a4c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

INPUT_CONFIG_PATH="$1"
CONFIG=""
INPUT_FAIL=$(default 'true' 'false' "${INPUT_FAIL}" 'true')

# check if a custom config have been provided
if [ -f "$GITHUB_WORKSPACE/$INPUT_CONFIG_PATH" ]; then
Expand Down Expand Up @@ -33,7 +34,12 @@ then
echo "::set-output name=result::$CAPTURE_OUTPUT"
echo "----------------------------------"
echo -e $DONATE_MSG
exit 1
if [ "${INPUT_FAIL}" = "true" ]; then
echo "::error::${GITLEAKS_RESULT}"
exit 1
else
echo "::warning::${GITLEAKS_RESULT}"
fi
else
GITLEAKS_RESULT=$(echo -e "\e[32m✅ SUCCESS! Your code is good to go!")
echo "$GITLEAKS_RESULT"
Expand Down

0 comments on commit 8286a4c

Please sign in to comment.