danger 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/danger/request_sources/github.rb +10 -3
- data/lib/danger/version.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2b3337b2e55d499b082ba5f7aed4f5216e95349c
|
4
|
+
data.tar.gz: c1bfe7f5a5de81631266d4afa0d82ca8d8f8b31d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ab6e3ef7b0db9db6032a2dbaea15d41ea56c7fdbc552677298cbd9c6587bb99346ad022b494f07917059a024252d785eff6ed0a821412c480f47bd715fb7c32
|
7
|
+
data.tar.gz: 714c8816a1fe0c8965460266f129589a8064b57dd0c601ed8b91f312a92e0e6bde6d522aa14f135efc2cc33e96047201aa1e36d2115f4a7bb34a77679c3424d0
|
@@ -50,9 +50,16 @@ module Danger
|
|
50
50
|
# Just remove the comment, if there's nothing to say.
|
51
51
|
delete_old_comments!
|
52
52
|
else
|
53
|
+
issues = client.issue_comments(ci_source.repo_slug, ci_source.pull_request_id)
|
54
|
+
editable_issues = issues.reject { |issue| issue[:body].include?("generated_by_danger") == false }
|
53
55
|
body = generate_comment(warnings: warnings, errors: errors, messages: messages)
|
54
|
-
|
55
|
-
|
56
|
+
|
57
|
+
if editable_issues.empty?
|
58
|
+
comment_result = client.add_comment(ci_source.repo_slug, ci_source.pull_request_id, body)
|
59
|
+
else
|
60
|
+
original_id = editable_issues.first[:id]
|
61
|
+
comment_result = client.update_comment(ci_source.repo_slug, original_id, body)
|
62
|
+
end
|
56
63
|
end
|
57
64
|
|
58
65
|
# Now, set the pull request status.
|
@@ -106,7 +113,7 @@ module Danger
|
|
106
113
|
end
|
107
114
|
end
|
108
115
|
|
109
|
-
def generate_comment(warnings:
|
116
|
+
def generate_comment(warnings: [], errors: [], messages: [])
|
110
117
|
require 'erb'
|
111
118
|
|
112
119
|
md_template = File.join(Danger.gem_path, "lib/danger/comment_generators/github.md.erb")
|
data/lib/danger/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: danger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Orta Therox
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-01-
|
12
|
+
date: 2016-01-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: claide
|
@@ -215,9 +215,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
215
215
|
version: '0'
|
216
216
|
requirements: []
|
217
217
|
rubyforge_project:
|
218
|
-
rubygems_version: 2.4.
|
218
|
+
rubygems_version: 2.4.6
|
219
219
|
signing_key:
|
220
220
|
specification_version: 4
|
221
221
|
summary: Ensure your pull request is up to standard with a nice DSL
|
222
222
|
test_files: []
|
223
|
-
has_rdoc:
|