Commit 91587a38 authored by Clement's avatar Clement Committed by Pierre Smeyers
Browse files

fix(rules): always use default config file

parent 669be7db
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -196,17 +196,13 @@ stages:
  }

  function install_gitleaks_rules() {
    # If present, import gitleaks rules found inside the git repository (in place of the default + Orange rules)
    if [[ -f ".gitleaks.toml" ]]
    then
      log_info "Using custom Gitleaks rules from project (\\e[33;1m.gitleaks.toml\\e[0m)"
      cp .gitleaks.toml ./gitleaks/rules.toml
      export gitleaks_rule_opts="--config ./gitleaks/rules.toml"
    elif [[ "$GITLEAKS_RULES" ]]
    then
      log_info "Using Gitleaks rules from env (\\e[33;1m\$GITLEAKS_RULES\\e[0m)"
      echo "$GITLEAKS_RULES" > ./gitleaks/rules.toml
      export gitleaks_rule_opts="--config ./gitleaks/rules.toml"
      echo "$GITLEAKS_RULES" > .gitleaks.toml
    else
      log_info "No Gitleaks rules found: use default"
    fi