Skip to content

Commit

Permalink
Only add a comment of PR is eligible
Browse files Browse the repository at this point in the history
This maybe fixes #159
  • Loading branch information
bastelfreak committed Apr 30, 2020
1 parent 0cc30df commit f1a094b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/models/pull_request.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,15 @@ 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 f1a094b

Please sign in to comment.