Skip to content

Commit

Permalink
Update entrypoint.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
patdz authored Jan 26, 2022
1 parent 6b48e47 commit 9490204
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ CONFIG=""

# check if a custom config have been provided
if [ -f "$GITHUB_WORKSPACE/$INPUT_CONFIG_PATH" ]; then
CONFIG=" --config-path=$GITHUB_WORKSPACE/$INPUT_CONFIG_PATH"
CONFIG=" --config=$GITHUB_WORKSPACE/$INPUT_CONFIG_PATH"
fi

echo running gitleaks "$(gitleaks version) with the following command👇"
Expand All @@ -14,13 +14,12 @@ DONATE_MSG="👋 maintaining gitleaks takes a lot of work so consider sponsoring

if [ "$GITHUB_EVENT_NAME" = "push" ]
then
echo gitleaks --path=$GITHUB_WORKSPACE --verbose --redact $CONFIG
CAPTURE_OUTPUT=$(gitleaks --path=$GITHUB_WORKSPACE --verbose --redact $CONFIG)
echo gitleaks --source=$GITHUB_WORKSPACE --verbose --redact $CONFIG
CAPTURE_OUTPUT=$(gitleaks detect --source=$GITHUB_WORKSPACE --verbose --redact $CONFIG)
elif [ "$GITHUB_EVENT_NAME" = "pull_request" ]
then
git --git-dir="$GITHUB_WORKSPACE/.git" log --left-right --cherry-pick --pretty=format:"%H" remotes/origin/$GITHUB_BASE_REF... > commit_list.txt
echo gitleaks --path=$GITHUB_WORKSPACE --verbose --redact --commits-file=commit_list.txt $CONFIG
CAPTURE_OUTPUT=$(gitleaks --path=$GITHUB_WORKSPACE --verbose --redact --commits-file=commit_list.txt $CONFIG)
echo gitleaks --source=$GITHUB_WORKSPACE --verbose --redact $CONFIG
CAPTURE_OUTPUT=$(gitleaks detect --source=$GITHUB_WORKSPACE --verbose --redact $CONFIG)
fi

if [ $? -eq 1 ]
Expand Down

0 comments on commit 9490204

Please sign in to comment.