dependabot-common 0.107.4 → 0.107.5
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: '04941cf855891d3f4b237c9076b0f60ab46501ca6631e980a2bff8da66cac9aa'
|
4
|
+
data.tar.gz: c78db2d55328edb6b357b8e2070cc5caf2dbe468a49fb777606f7c557b0a1a92
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 45a034b06b79a0a173ca1ff7b3acf67266057f02daa1aa566b82c7f72252fb117598505e82ff5df42447cb2c16c8da7a80119e0317c5e16122b1a490e03b0233
|
7
|
+
data.tar.gz: b001a3939ca512f456e12d23de584bed03294f7415b6d3262b0db7ac1e8adffd6bf8475f589dee2c50818f04c54800c0b31b37415e35dff7d23c016ea7d96613
|
@@ -18,7 +18,8 @@ module Dependabot
|
|
18
18
|
:credentials, :pr_message_footer, :custom_labels,
|
19
19
|
:author_details, :signature_key, :vulnerabilities_fixed,
|
20
20
|
:reviewers, :assignees, :milestone, :branch_name_separator,
|
21
|
-
:branch_name_prefix, :github_redirection_service
|
21
|
+
:branch_name_prefix, :github_redirection_service,
|
22
|
+
:custom_headers
|
22
23
|
|
23
24
|
def initialize(source:, base_commit:, dependencies:, files:, credentials:,
|
24
25
|
pr_message_footer: nil, custom_labels: nil,
|
@@ -27,7 +28,8 @@ module Dependabot
|
|
27
28
|
vulnerabilities_fixed: {}, branch_name_separator: "/",
|
28
29
|
branch_name_prefix: "dependabot",
|
29
30
|
label_language: false, automerge_candidate: false,
|
30
|
-
github_redirection_service: "github-redirect.dependabot.com"
|
31
|
+
github_redirection_service: "github-redirect.dependabot.com",
|
32
|
+
custom_headers: nil)
|
31
33
|
@dependencies = dependencies
|
32
34
|
@source = source
|
33
35
|
@base_commit = base_commit
|
@@ -46,6 +48,7 @@ module Dependabot
|
|
46
48
|
@label_language = label_language
|
47
49
|
@automerge_candidate = automerge_candidate
|
48
50
|
@github_redirection_service = github_redirection_service
|
51
|
+
@custom_headers = custom_headers
|
49
52
|
|
50
53
|
check_dependencies_have_previous_version
|
51
54
|
end
|
@@ -91,7 +94,8 @@ module Dependabot
|
|
91
94
|
labeler: labeler,
|
92
95
|
reviewers: reviewers,
|
93
96
|
assignees: assignees,
|
94
|
-
milestone: milestone
|
97
|
+
milestone: milestone,
|
98
|
+
custom_headers: custom_headers
|
95
99
|
)
|
96
100
|
end
|
97
101
|
|
@@ -11,12 +11,12 @@ module Dependabot
|
|
11
11
|
class Github
|
12
12
|
attr_reader :source, :branch_name, :base_commit, :credentials,
|
13
13
|
:files, :pr_description, :pr_name, :commit_message,
|
14
|
-
:author_details, :signature_key,
|
14
|
+
:author_details, :signature_key, :custom_headers,
|
15
15
|
:labeler, :reviewers, :assignees, :milestone
|
16
16
|
|
17
17
|
def initialize(source:, branch_name:, base_commit:, credentials:,
|
18
18
|
files:, commit_message:, pr_description:, pr_name:,
|
19
|
-
author_details:, signature_key:,
|
19
|
+
author_details:, signature_key:, custom_headers:,
|
20
20
|
labeler:, reviewers:, assignees:, milestone:)
|
21
21
|
@source = source
|
22
22
|
@branch_name = branch_name
|
@@ -28,6 +28,7 @@ module Dependabot
|
|
28
28
|
@pr_name = pr_name
|
29
29
|
@author_details = author_details
|
30
30
|
@signature_key = signature_key
|
31
|
+
@custom_headers = custom_headers
|
31
32
|
@labeler = labeler
|
32
33
|
@reviewers = reviewers
|
33
34
|
@assignees = assignees
|
@@ -255,14 +256,19 @@ module Dependabot
|
|
255
256
|
source.branch || default_branch,
|
256
257
|
branch_name,
|
257
258
|
pr_name,
|
258
|
-
pr_description
|
259
|
+
pr_description,
|
260
|
+
headers: custom_headers || {}
|
259
261
|
)
|
260
262
|
rescue Octokit::UnprocessableEntity => e
|
263
|
+
handle_pr_creation_error(e)
|
264
|
+
end
|
265
|
+
|
266
|
+
def handle_pr_creation_error(error)
|
261
267
|
# Ignore races that we lose
|
262
|
-
return if
|
268
|
+
return if error.message.include?("pull request already exists")
|
263
269
|
|
264
270
|
# Ignore cases where the target branch has been deleted
|
265
|
-
return if
|
271
|
+
return if error.message.include?("field: base") &&
|
266
272
|
source.branch &&
|
267
273
|
!branch_exists?(source.branch)
|
268
274
|
|
data/lib/dependabot/version.rb
CHANGED