Class: Ace::Git::Secrets::Commands::CheckReleaseCommand
- Inherits:
-
Object
- Object
- Ace::Git::Secrets::Commands::CheckReleaseCommand
- Defined in:
- lib/ace/git/secrets/commands/check_release_command.rb
Overview
CLI command for pre-release security check
Class Method Summary collapse
-
.execute(options) ⇒ Integer
Execute check-release command.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(options) ⇒ CheckReleaseCommand
constructor
A new instance of CheckReleaseCommand.
Constructor Details
#initialize(options) ⇒ CheckReleaseCommand
Returns a new instance of CheckReleaseCommand.
16 17 18 |
# File 'lib/ace/git/secrets/commands/check_release_command.rb', line 16 def initialize() @options = end |
Class Method Details
.execute(options) ⇒ Integer
Execute check-release command
12 13 14 |
# File 'lib/ace/git/secrets/commands/check_release_command.rb', line 12 def self.execute() new().execute end |
Instance Method Details
#execute ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/ace/git/secrets/commands/check_release_command.rb', line 20 def execute # Ensure gitleaks is available Atoms::GitleaksRunner.ensure_available! puts "Performing pre-release security check..." puts gate = Organisms::ReleaseGate.new( repository_path: ".", strict: @options[:strict], gitleaks_config: Ace::Git::Secrets.gitleaks_config_path ) result = gate.check # Output formatted result format = @options[:format] || Ace::Git::Secrets.config.dig("output", "format") || "table" puts gate.format_result(result, format: format) result[:exit_code] rescue => e puts "Error: #{e.}" puts e.backtrace.first(5).join("\n") if ENV["DEBUG"] 2 end |