Skip to content

Commit

Permalink
Merge pull request #161 from voxpupuli/updates2
Browse files Browse the repository at this point in the history
Only add a comment of PR is eligible
  • Loading branch information
bastelfreak authored May 1, 2020
2 parents a5e1293 + a12096c commit e259cc9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/models/pull_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,16 @@ def ensure_label_is_detached(label)
##
# Add a comment with the given text
def add_comment(text)
# TODO: why can request be nil and what is request
req = begin
request
rescue StandardError
nil
end
# Only attach a comment if eligible_for_comment is true (The first iteration
# after the mergeable state changed to false)
return unless eligible_for_comment

Raven.capture_message('Added a comment',
extra: { text: text,
repo: repository.github_url,
Expand Down

0 comments on commit e259cc9

Please sign in to comment.