danger 6.0.3 → 6.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/danger/ci_source/cirrus.rb +3 -5
- data/lib/danger/ci_source/gitlab_ci.rb +9 -4
- data/lib/danger/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0d07cd853986d22b15d4aed8699bd1877b506990221ccfd111dda79f004a4941
|
4
|
+
data.tar.gz: a5eff46697b1974fe5356a5276ee2913532732c6de08ab88d98eaedbb0131681
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f61272da6dbafad0f462d30567616125bdb31363ead8421b54c4fe302708848af0f90288a877a9213933b9db53c7eb8c11148da5300024e234983ae924de9d94
|
7
|
+
data.tar.gz: eeb94d72d083a0819a30f5af3029c8dbae5cede42fb5b166775f3100230756952e5147f250abed70269a75aaa81b21172fb6b5c325356f810a5b3678fc24fef3
|
@@ -2,12 +2,10 @@ require "danger/request_sources/github/github"
|
|
2
2
|
|
3
3
|
module Danger
|
4
4
|
# ### CI Setup
|
5
|
-
# You need to edit your `.cirrus.yml` to include `
|
5
|
+
# You need to edit your `.cirrus.yml` to include `bundler exec danger`.
|
6
6
|
#
|
7
7
|
# Adding this to your `.cirrus.yml` allows Danger to fail your build, both on the Cirrus CI website and within your Pull Request.
|
8
|
-
# With that set up, you can edit your
|
9
|
-
#
|
10
|
-
# ### Token Setup
|
8
|
+
# With that set up, you can edit your task to add `bundler exec danger` in any script instruction.
|
11
9
|
class Cirrus < CI
|
12
10
|
def self.validates_as_ci?(env)
|
13
11
|
env.key? "CIRRUS_CI"
|
@@ -25,7 +23,7 @@ module Danger
|
|
25
23
|
def initialize(env)
|
26
24
|
self.repo_slug = env["CIRRUS_REPO_FULL_NAME"]
|
27
25
|
if env["CIRRUS_PR"].to_i > 0
|
28
|
-
self.pull_request_id = env["
|
26
|
+
self.pull_request_id = env["CIRRUS_PR"]
|
29
27
|
end
|
30
28
|
self.repo_url = env["CIRRUS_GIT_CLONE_URL"]
|
31
29
|
end
|
@@ -39,11 +39,16 @@ module Danger
|
|
39
39
|
base_commit = env["CI_COMMIT_SHA"]
|
40
40
|
client = RequestSources::GitLab.new(nil, env).client
|
41
41
|
|
42
|
-
|
43
|
-
|
44
|
-
|
42
|
+
if (Gem::Version.new(client.version.version) >= Gem::Version.new("10.7"))
|
43
|
+
#Use the 'list merge requests associated with a commit' API, for speeed
|
44
|
+
# (GET /projects/:id/repository/commits/:sha/merge_requests) available for GitLab >= 10.7
|
45
|
+
merge_request = client.commit_merge_requests(project_path, base_commit, state: :opened).first
|
46
|
+
else
|
47
|
+
merge_requests = client.merge_requests(project_path, state: :opened)
|
48
|
+
merge_request = merge_requests.auto_paginate.find do |mr|
|
49
|
+
mr.sha == base_commit
|
50
|
+
end
|
45
51
|
end
|
46
|
-
|
47
52
|
merge_request.nil? ? 0 : merge_request.iid
|
48
53
|
end
|
49
54
|
|
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: 6.0.
|
4
|
+
version: 6.0.4
|
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-04-
|
12
|
+
date: 2019-04-15 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: claide
|