Method: Fastlane::Actions::FindTicketsAction.run

Defined in:
lib/fastlane/plugin/cerberus/actions/find_tickets_action.rb

.run(params) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fastlane/plugin/cerberus/actions/find_tickets_action.rb', line 7

def self.run(params)
  regex = Regexp.new(params[:matching])
  changelog = log(from: params[:from], to: params[:to], pretty: params[:pretty])

  if changelog.to_s.empty?
    UI.important('Git Tickets: No changes found.')
    return []
  end

  tickets = tickets(log: changelog, regex: regex)
  exclude_regex = Regexp.new(params[:excluding]) unless params[:excluding].to_s.empty?
  tickets = filter_tickets(tickets: tickets, exclude_regex: exclude_regex) if exclude_regex
  UI.important("Jira Issues: #{tickets.join(', ')}")
  return tickets
end