dependabot-common 0.342.1 → 0.342.2
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 +4 -4
- data/lib/dependabot/git_commit_checker.rb +21 -4
- data/lib/dependabot.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: 119ca0f68304d844107397afffa3ad2e46c139a787e8c96e5ca954e367bf7359
|
|
4
|
+
data.tar.gz: c7ced6c43c2ab909541c71e513d4774e036f8408d3f7220069e17dff776e8ffe
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 11d3e8185b084316449bc004ef25a3653081719fbb9dbe7c340aaaafa8dab9f2caefce2277ba260fae4c0f9f894d7c4ec3fda7d59ea80a544b4729c41c490fd8
|
|
7
|
+
data.tar.gz: 4b8c05569a0fa3a8a9778f3e488f0f3c4908787e327dd77a18fb4e4ba20eb2426c58b0fe62b544f38dec650e8f3b0ea5483fe89d838c27a77c732d8e7047d68d
|
|
@@ -27,6 +27,9 @@ module Dependabot
|
|
|
27
27
|
)$
|
|
28
28
|
/ix
|
|
29
29
|
|
|
30
|
+
# String pattern for matching version tags with optional prefixes (e.g., "v1.2.3" matches "1.2.3")
|
|
31
|
+
VERSION_TAG_MATCH_PATTERN = "(?:[^0-9\\.]|\\A)%s\\z"
|
|
32
|
+
|
|
30
33
|
sig do
|
|
31
34
|
params(
|
|
32
35
|
dependency: Dependabot::Dependency,
|
|
@@ -72,9 +75,7 @@ module Dependabot
|
|
|
72
75
|
return false if branch == ref
|
|
73
76
|
return true if branch
|
|
74
77
|
return true if dependency.version&.start_with?(T.must(ref))
|
|
75
|
-
|
|
76
|
-
# If the specified `ref` is actually a tag, we're pinned
|
|
77
|
-
return true if local_upload_pack&.match?(%r{ refs/tags/#{ref}$})
|
|
78
|
+
return true if ref_matches_tag?
|
|
78
79
|
|
|
79
80
|
# Assume we're pinned unless the specified `ref` is actually a branch
|
|
80
81
|
return true unless local_upload_pack&.match?(%r{ refs/heads/#{ref}$})
|
|
@@ -280,6 +281,22 @@ module Dependabot
|
|
|
280
281
|
max_local_tag(select_lower_precision(tags))
|
|
281
282
|
end
|
|
282
283
|
|
|
284
|
+
# Check if the current ref matches any Git tag (handling version tag prefixes)
|
|
285
|
+
sig { returns(T::Boolean) }
|
|
286
|
+
def ref_matches_tag?
|
|
287
|
+
return false unless ref
|
|
288
|
+
|
|
289
|
+
# Handle tag prefixes (e.g., v0.0.13 for ref 0.0.13) by checking if any local tag matches the version
|
|
290
|
+
if version_tag?(T.must(ref)) && local_tags.any? do |tag|
|
|
291
|
+
tag.name =~ Regexp.new(VERSION_TAG_MATCH_PATTERN % Regexp.escape(T.must(ref)))
|
|
292
|
+
end
|
|
293
|
+
return true
|
|
294
|
+
end
|
|
295
|
+
|
|
296
|
+
# Fallback to exact match for non-version refs
|
|
297
|
+
local_upload_pack&.match?(%r{ refs/tags/#{ref}$}) || false
|
|
298
|
+
end
|
|
299
|
+
|
|
283
300
|
# Find the latest version with the same precision as the pinned version.
|
|
284
301
|
sig { params(tags: T::Array[Dependabot::GitRef]).returns(T::Array[Dependabot::GitRef]) }
|
|
285
302
|
def select_matching_existing_precision(tags)
|
|
@@ -524,7 +541,7 @@ module Dependabot
|
|
|
524
541
|
sig { params(version: String).returns(T.nilable(String)) }
|
|
525
542
|
def listing_tag_for_version(version)
|
|
526
543
|
listing_tags
|
|
527
|
-
.find { |t| t.name =~
|
|
544
|
+
.find { |t| t.name =~ Regexp.new(VERSION_TAG_MATCH_PATTERN % Regexp.escape(version)) }
|
|
528
545
|
&.name
|
|
529
546
|
end
|
|
530
547
|
|
data/lib/dependabot.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: dependabot-common
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.342.
|
|
4
|
+
version: 0.342.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Dependabot
|
|
@@ -629,7 +629,7 @@ licenses:
|
|
|
629
629
|
- MIT
|
|
630
630
|
metadata:
|
|
631
631
|
bug_tracker_uri: https://github.com/dependabot/dependabot-core/issues
|
|
632
|
-
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.342.
|
|
632
|
+
changelog_uri: https://github.com/dependabot/dependabot-core/releases/tag/v0.342.2
|
|
633
633
|
rdoc_options: []
|
|
634
634
|
require_paths:
|
|
635
635
|
- lib
|