Class: Verto::DSL::UpdateChangelog::WithMergedPullRequests

Inherits:
Object
  • Object
show all
Includes:
FilteredBy
Defined in:
lib/verto/dsl/update_changelog/with_merged_pull_requests.rb

Instance Method Summary collapse

Methods included from FilteredBy

included

Instance Method Details

#call(message_pattern = /.+/) ⇒ Object



10
11
12
13
14
15
# File 'lib/verto/dsl/update_changelog/with_merged_pull_requests.rb', line 10

def call(message_pattern = /.+/)
  # FIXME: Format the command
  executor.run(
    %q(git log --oneline --decorate  | grep -B 100 -m 1 "tag:" | grep "pull request" | awk '{print $1}' | xargs -r git show --format='%b' | grep -v Approved | grep -v "^$") # rubocop:disable Layout/LineLength
  ).output.split("\n").map(&:strip).select { |pr_message| message_pattern.match? pr_message }
end