Class: Ace::Git::Secrets::CLI::Commands::Scan

Inherits:
Support::Cli::Command
  • Object
show all
Includes:
Support::Cli::Base
Defined in:
lib/ace/git/secrets/cli/commands/scan.rb

Overview

ace-support-cli command for scanning repository for tokens

Requires gitleaks to be installed (brew install gitleaks)

Exit codes:

  • 0: Clean (no tokens found)

  • 1: Tokens detected

  • 2: Error occurred

Instance Method Summary collapse

Instance Method Details

#call(**options) ⇒ Object



35
36
37
38
39
40
41
42
43
44
45
# File 'lib/ace/git/secrets/cli/commands/scan.rb', line 35

def call(**options)
  debug_log("Starting scan with options: #{format_pairs(options)}", options)

  exit_code = Ace::Git::Secrets::Commands::ScanCommand.execute(options)
  raise Ace::Support::Cli::Error.new("Tokens detected", exit_code: exit_code) if exit_code != 0
rescue Ace::Support::Cli::Error
  raise
rescue => e
  debug_log(e.full_message, options) if debug?(options)
  raise Ace::Support::Cli::Error.new(e.message, exit_code: 2)
end