Class: Dependabot::GithubActions::UpdateChecker
- Inherits:
-
UpdateCheckers::Base
- Object
- UpdateCheckers::Base
- Dependabot::GithubActions::UpdateChecker
show all
- Extended by:
- T::Sig
- Defined in:
- lib/dependabot/github_actions/update_checker.rb,
lib/dependabot/github_actions/update_checker/latest_version_finder.rb
Defined Under Namespace
Classes: LatestVersionFinder
Constant Summary
collapse
- GitSource =
T.type_alias { T::Hash[Symbol, String] }
Instance Method Summary
collapse
Instance Method Details
#latest_resolvable_version ⇒ Object
35
36
37
38
|
# File 'lib/dependabot/github_actions/update_checker.rb', line 35
def latest_resolvable_version
latest_version
end
|
#latest_resolvable_version_with_no_unlock ⇒ Object
41
42
43
44
|
# File 'lib/dependabot/github_actions/update_checker.rb', line 41
def latest_resolvable_version_with_no_unlock
dependency.version
end
|
#latest_version ⇒ Object
27
28
29
30
31
32
|
# File 'lib/dependabot/github_actions/update_checker.rb', line 27
def latest_version
@latest_version ||= T.let(
T.must(latest_version_finder).latest_release_version,
T.nilable(T.any(String, Gem::Version))
)
end
|
#lowest_resolvable_security_fix_version ⇒ Object
47
48
49
50
|
# File 'lib/dependabot/github_actions/update_checker.rb', line 47
def lowest_resolvable_security_fix_version
lowest_security_fix_version
end
|
#lowest_security_fix_version ⇒ Object
53
54
55
56
57
58
|
# File 'lib/dependabot/github_actions/update_checker.rb', line 53
def lowest_security_fix_version
@lowest_security_fix_version ||= T.let(
T.must(latest_version_finder).lowest_security_fix_release&.fetch(:version),
T.nilable(Dependabot::Version)
)
end
|
#up_to_date? ⇒ Boolean
61
62
63
|
# File 'lib/dependabot/github_actions/update_checker.rb', line 61
def up_to_date?
super && !onboarded_requirements_changed?
end
|
#updated_requirements ⇒ Object
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
# File 'lib/dependabot/github_actions/update_checker.rb', line 66
def updated_requirements
updated_reqs = dependency.requirements.map do |req|
source = T.cast(req.source, GitSource)
updated = updated_ref(source, onboarded: onboarded_requirement?(req))
next req unless updated
current = source[:ref]
if req[:type] == "git" &&
git_commit_checker.ref_looks_like_commit_sha?(updated) &&
git_commit_checker.ref_looks_like_commit_sha?(T.must(current)) &&
updated.start_with?(T.must(current))
next req
end
new_source = source.merge(ref: updated)
req.merge(source: new_source)
end
wrap_requirements(updated_reqs)
end
|