Skip to content

Commit

Permalink
Merge pull request #92 from jhass/ghpr_ignore_failed
Browse files Browse the repository at this point in the history
Ignore failed pull request comments
  • Loading branch information
mmozuras committed Sep 20, 2015
2 parents ebf34e7 + 0127cbd commit 8c68f32
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/pronto/formatter/github_pull_request_formatter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ def create_comment(client, sha, body, path, position)
comments = client.pull_comments(sha)
existing = comments.any? { |c| comment == c }
client.create_pull_comment(comment) unless existing
rescue Octokit::UnprocessableEntity => e
# The diff output of the local git version and Github is not always
# consistent, especially in areas where file renames happened, Github
# tends to recognize these better, leading to messages we can't post
# because their diff position is non-existent on Github.
# Ignore such occasions and continue posting other messages.
STDERR.puts "Failed to post: #{comment.inspect} with #{e.message}"
end
end
end
Expand Down

0 comments on commit 8c68f32

Please sign in to comment.