dependabot-git_submodules 0.86.5 → 0.86.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3d2cb9d4cf2615955eeffd12a06634ad30523db016645fe0fb46251d1577360a
4
- data.tar.gz: 948fb5f7722c0773bd27ba38b9d34683c76447de7b952b835bbbadd8456705be
3
+ metadata.gz: 2120aee27d7b74f0943268c797e28660384b2d7ca5828d94e19e3dc324b94a76
4
+ data.tar.gz: 296bf690c7e0f7066fc5e3c6c0cbc8ab6e77786315e49dede516b4d25dc6a4dc
5
5
  SHA512:
6
- metadata.gz: 0ab6996df2e8d454004ebb8bab642134b38d91c3f70701d5b1c89387b815630942813376a0481d136fea4f3de7c6ef5fed5da8a67d205395fe857936b8dcc70c
7
- data.tar.gz: 8a06685fa48e2997fc17e2b8f515351a33a7169726fdd5426870b241e7d63a0d4f2b248f2846859f02cc94d12c19555a250c874332ab46632d1faab854f9ff7e
6
+ metadata.gz: f6afaf1b996d8203b8301c686c9a45727d6d426e34cbfff731a8bdf96f49ceb225610844b7fe8cbf8321b890fe5d3f59068f0e29014da44fcfc9ddee05d43ce6
7
+ data.tar.gz: 62ca92d9d335f869234dfac1cb3656dd49e0c601c9c3b4fa0e62685398623a3b7c98ea8eb54703d4759e6c29fea87f46a5fbc0e4e8e80003ca415ba289adf7af
@@ -47,11 +47,7 @@ module Dependabot
47
47
  cleanpath.to_path.gsub(%r{^/*}, "")
48
48
  sha = case source.provider
49
49
  when "github"
50
- github_client_for_source.contents(
51
- repo,
52
- path: path,
53
- ref: commit
54
- ).sha
50
+ fetch_github_submodule_commit(path)
55
51
  when "gitlab"
56
52
  tmp_path = path.gsub(%r{^/*}, "")
57
53
  gitlab_client.get_file(repo, tmp_path, commit).blob_id
@@ -67,6 +63,19 @@ module Dependabot
67
63
  rescue Octokit::NotFound, Gitlab::Error::NotFound
68
64
  raise Dependabot::DependencyFileNotFound, path
69
65
  end
66
+
67
+ def fetch_github_submodule_commit(path)
68
+ content = github_client_for_source.contents(
69
+ repo,
70
+ path: path,
71
+ ref: commit
72
+ )
73
+ if content.is_a?(Array) || content.type != "submodule"
74
+ raise Dependabot::DependencyFileNotFound, path
75
+ end
76
+
77
+ content.sha
78
+ end
70
79
  end
71
80
  end
72
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dependabot-git_submodules
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.86.5
4
+ version: 0.86.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dependabot
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - '='
18
18
  - !ruby/object:Gem::Version
19
- version: 0.86.5
19
+ version: 0.86.6
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - '='
25
25
  - !ruby/object:Gem::Version
26
- version: 0.86.5
26
+ version: 0.86.6
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: byebug
29
29
  requirement: !ruby/object:Gem::Requirement