danger 5.13.0 → 5.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/danger/commands/runner.rb +3 -0
- data/lib/danger/danger_core/executor.rb +7 -5
- data/lib/danger/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 3ad7a6d0ad0c2cac62253cf27996a549026159df
|
4
|
+
data.tar.gz: 247abc76bb8cd25047c242835330e09413268d40
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc508c5fea76dab88a9fdbc0574e8d8d8674e8a21a7f53bc4d39c94bc9ba413ca4dae3a87d2f7081c1e180234ee2c659b7922897eba840e156cb30c4636d2ac2
|
7
|
+
data.tar.gz: 3863dd8cf1b5470bda0af673ea8bf3a6b22709959335b6fc7f29394523bb96a325aed0e499bb8b844c2bc6239b5a446415acdd434dae334d9696c3718a145dc1
|
@@ -38,6 +38,7 @@ module Danger
|
|
38
38
|
@base = argv.option("base")
|
39
39
|
@head = argv.option("head")
|
40
40
|
@fail_on_errors = argv.option("fail-on-errors", false)
|
41
|
+
@fail_if_no_pr = argv.option("fail-if-no-pr", false)
|
41
42
|
@new_comment = argv.flag?("new-comment")
|
42
43
|
@remove_previous_comments = argv.flag?("remove-previous-comments")
|
43
44
|
@danger_id = argv.option("danger_id", "danger")
|
@@ -59,6 +60,7 @@ module Danger
|
|
59
60
|
["--base=[master|dev|stable]", "A branch/tag/commit to use as the base of the diff"],
|
60
61
|
["--head=[master|dev|stable]", "A branch/tag/commit to use as the head"],
|
61
62
|
["--fail-on-errors=<true|false>", "Should always fail the build process, defaults to false"],
|
63
|
+
["--fail-if-no-pr=<true|false>", "Should fail the build process if no PR is found (useful for CircleCI), defaults to false"],
|
62
64
|
["--dangerfile=<path/to/dangerfile>", "The location of your Dangerfile"],
|
63
65
|
["--danger_id=<id>", "The identifier of this Danger instance"],
|
64
66
|
["--new-comment", "Makes Danger post a new comment instead of editing its previous one"],
|
@@ -74,6 +76,7 @@ module Danger
|
|
74
76
|
danger_id: @danger_id,
|
75
77
|
new_comment: @new_comment,
|
76
78
|
fail_on_errors: @fail_on_errors,
|
79
|
+
fail_if_no_pr: @fail_if_no_pr,
|
77
80
|
remove_previous_comments: @remove_previous_comments
|
78
81
|
)
|
79
82
|
end
|
@@ -13,12 +13,13 @@ module Danger
|
|
13
13
|
danger_id: nil,
|
14
14
|
new_comment: nil,
|
15
15
|
fail_on_errors: nil,
|
16
|
+
fail_if_no_pr: nil,
|
16
17
|
remove_previous_comments: nil)
|
17
18
|
# Create a silent Cork instance if cork is nil, as it's likely a test
|
18
19
|
cork ||= Cork::Board.new(silent: false, verbose: false)
|
19
20
|
|
20
21
|
# Run some validations
|
21
|
-
validate!(cork)
|
22
|
+
validate!(cork, fail_if_no_pr: fail_if_no_pr)
|
22
23
|
|
23
24
|
# OK, we now know that Danger can run in this enviroment
|
24
25
|
env ||= EnvironmentManager.new(system_env, cork)
|
@@ -41,9 +42,9 @@ module Danger
|
|
41
42
|
exit(1) if fail_on_errors && ran_status
|
42
43
|
end
|
43
44
|
|
44
|
-
def validate!(cork)
|
45
|
+
def validate!(cork, fail_if_no_pr: false)
|
45
46
|
validate_ci!
|
46
|
-
validate_pr!(cork)
|
47
|
+
validate_pr!(cork, fail_if_no_pr)
|
47
48
|
end
|
48
49
|
|
49
50
|
private
|
@@ -58,11 +59,12 @@ module Danger
|
|
58
59
|
end
|
59
60
|
|
60
61
|
# Could we determine that the CI source is inside a PR?
|
61
|
-
def validate_pr!(cork)
|
62
|
+
def validate_pr!(cork, fail_if_no_pr)
|
62
63
|
unless EnvironmentManager.pr?(system_env)
|
63
64
|
ci_name = EnvironmentManager.local_ci_source(system_env).name.split("::").last
|
64
65
|
cork.puts "Not a #{ci_name} Pull Request - skipping `danger` run".yellow
|
65
|
-
|
66
|
+
|
67
|
+
exit(fail_if_no_pr ? 1 : 0)
|
66
68
|
end
|
67
69
|
end
|
68
70
|
|
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: 5.
|
4
|
+
version: 5.14.0
|
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: 2019-
|
12
|
+
date: 2019-02-11 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: claide
|
@@ -300,7 +300,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
300
300
|
version: '0'
|
301
301
|
requirements: []
|
302
302
|
rubyforge_project:
|
303
|
-
rubygems_version: 2.
|
303
|
+
rubygems_version: 2.5.2.3
|
304
304
|
signing_key:
|
305
305
|
specification_version: 4
|
306
306
|
summary: Like Unit Tests, but for your Team Culture.
|