danger 8.1.0 → 8.2.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a23a15079e019e675afdc325babf115a1a6f38ddbd06a5ba11dd93243ea1dfa0
|
4
|
+
data.tar.gz: 380335b8eb423be1096f3b25b3f2602d24d7288b70deb69e8b9991e6dcf09d16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2d68ba968f860e6b4631536548d23279677645d20e7cb5d9567c73222a87128c027664e72f176bca01a31adbbbc2b8f123f5f20997e005a428cc2321e979d023
|
7
|
+
data.tar.gz: 10ab5f0cb6c3810e0f4520724854a3a8e3e4aeef35c252ed7a3ac729a2407c73df382a6cb98b1682170efd215bc495a11a312fa1d47f5d1b546632bd415b8d0f
|
@@ -0,0 +1,61 @@
|
|
1
|
+
require "git"
|
2
|
+
require "danger/request_sources/local_only"
|
3
|
+
|
4
|
+
module Danger
|
5
|
+
# Concourse CI Integration
|
6
|
+
#
|
7
|
+
# https://concourse-ci.org/
|
8
|
+
#
|
9
|
+
# ### CI Setup
|
10
|
+
#
|
11
|
+
# With Concourse, you run the docker images yourself, so you will want to add `yarn danger ci` within one of your build jobs.
|
12
|
+
#
|
13
|
+
# ``` shell
|
14
|
+
# build:
|
15
|
+
# image: golang
|
16
|
+
# commands:
|
17
|
+
# - ...
|
18
|
+
# - yarn danger ci
|
19
|
+
# ```
|
20
|
+
#
|
21
|
+
# ### Environment Variable Setup
|
22
|
+
#
|
23
|
+
# As this is self-hosted, you will need to add the `CONCOURSE` environment variable `export CONCOURSE=true` to your build environment,
|
24
|
+
# as well as setting environment variables for `PULL_REQUEST_ID` and `REPO_SLUG`. Assuming you are using the github pull request resource
|
25
|
+
# https://github.com/jtarchie/github-pullrequest-resource the id of the PR can be accessed from `git config --get pullrequest.id`.
|
26
|
+
#
|
27
|
+
# ### Token Setup
|
28
|
+
#
|
29
|
+
# Once again as this is self-hosted, you will need to add `DANGER_GITHUB_API_TOKEN` environment variable to the build environment.
|
30
|
+
# The suggested method of storing the token is within the vault - https://concourse-ci.org/creds.html
|
31
|
+
|
32
|
+
class Concourse < CI
|
33
|
+
def self.validates_as_ci?(env)
|
34
|
+
env.key? "CONCOURSE"
|
35
|
+
end
|
36
|
+
|
37
|
+
def self.validates_as_pr?(env)
|
38
|
+
exists = ["PULL_REQUEST_ID", "REPO_SLUG"].all? { |x| env[x] && !env[x].empty? }
|
39
|
+
exists && env["PULL_REQUEST_ID"].to_i > 0
|
40
|
+
end
|
41
|
+
|
42
|
+
def supported_request_sources
|
43
|
+
@supported_request_sources ||= [
|
44
|
+
Danger::RequestSources::GitHub,
|
45
|
+
Danger::RequestSources::GitLab,
|
46
|
+
Danger::RequestSources::BitbucketServer,
|
47
|
+
Danger::RequestSources::BitbucketCloud
|
48
|
+
]
|
49
|
+
end
|
50
|
+
|
51
|
+
def initialize(env)
|
52
|
+
self.repo_slug = env["REPO_SLUG"]
|
53
|
+
|
54
|
+
if env["PULL_REQUEST_ID"].to_i > 0
|
55
|
+
self.pull_request_id = env["PULL_REQUEST_ID"]
|
56
|
+
end
|
57
|
+
self.repo_url = GitRepo.new.origins
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
@@ -206,10 +206,10 @@ module Danger
|
|
206
206
|
markdowns: markdowns
|
207
207
|
)
|
208
208
|
|
209
|
-
rest_inline_violations = submit_inline_comments!({
|
209
|
+
rest_inline_violations = submit_inline_comments!(**{
|
210
210
|
danger_id: danger_id,
|
211
211
|
previous_violations: previous_violations
|
212
|
-
}.merge(
|
212
|
+
}.merge(inline_violations))
|
213
213
|
|
214
214
|
main_violations = merge_violations(
|
215
215
|
regular_violations, rest_inline_violations
|
@@ -224,11 +224,11 @@ module Danger
|
|
224
224
|
|
225
225
|
# If there are still violations to show
|
226
226
|
if main_violations_sum.any?
|
227
|
-
body = generate_comment({
|
227
|
+
body = generate_comment(**{
|
228
228
|
template: "gitlab",
|
229
229
|
danger_id: danger_id,
|
230
230
|
previous_violations: previous_violations
|
231
|
-
}.merge(
|
231
|
+
}.merge(main_violations))
|
232
232
|
|
233
233
|
comment_result =
|
234
234
|
if should_create_new_comment
|
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: 8.
|
4
|
+
version: 8.2.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: 2020-10-
|
12
|
+
date: 2020-10-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: claide
|
@@ -214,6 +214,7 @@ files:
|
|
214
214
|
- lib/danger/ci_source/code_build.rb
|
215
215
|
- lib/danger/ci_source/codefresh.rb
|
216
216
|
- lib/danger/ci_source/codeship.rb
|
217
|
+
- lib/danger/ci_source/concourse.rb
|
217
218
|
- lib/danger/ci_source/dotci.rb
|
218
219
|
- lib/danger/ci_source/drone.rb
|
219
220
|
- lib/danger/ci_source/github_actions.rb
|