Skip to content

Commit

Permalink
Adjust gitleaks container commands (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
joserenatosilva authored and rafaveira3 committed Jan 6, 2020
1 parent e0bf1c4 commit d158443
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions api/config.yaml
Expand Up @@ -308,10 +308,12 @@ gitleaks:
git clone -b %GIT_BRANCH% --single-branch %GIT_REPO% code --quiet 2> /tmp/errorGitCloneGitleaks
if [ $? -eq 0 ]; then
touch /tmp/results.json
timeout -t 300 $(which gitleaks) --log=warn --report=/tmp/results.json --repo-path=./code --branch=%GIT_BRANCH% --repo-config > /tmp/errorGitleaks ||
echo "ERROR_TIMEOUT_GITLEAKS"
if [ $? -eq 2 ]; then
echo -n 'ERROR_RUNNING_GITLEAKS'
timeout -t 360 $(which gitleaks) --log=warn --report=/tmp/results.json --repo-path=./code --branch=%GIT_BRANCH% --repo-config &> /tmp/errorGitleaks
if [[ $? -eq 124 || $? -eq 143 ]]; then #timeout exit codes
echo 'ERROR_TIMEOUT_GITLEAKS'
cat /tmp/errorGitleaks
elif [ $? -eq 2 ]; then
echo 'ERROR_RUNNING_GITLEAKS'
cat /tmp/errorGitleaks
else
jq -j -M -c . /tmp/results.json
Expand Down

0 comments on commit d158443

Please sign in to comment.