Skip to content

Commit 59057a7

Browse files
kbukum1Copilot
andcommitted
Align dry-run.rb blocked_versions with version-requirement rename
Update bin/dry-run.rb (from merged PR #14916) to use 'version-requirement' instead of 'version' in the blocked_versions data structure, matching the rename done in job.rb and the API contract. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent ca8424d commit 59057a7

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

bin/dry-run.rb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@
228228

229229
unless ENV["BLOCKED_VERSIONS"].to_s.strip.empty?
230230
# For example:
231-
# [{"dependency-name":"event-stream","version":"= 3.3.6","reason":"malware"}]
231+
# [{"dependency-name":"event-stream","version-requirement":"= 3.3.6","reason":"malware"}]
232232
$options[:blocked_versions] = JSON.parse(ENV.fetch("BLOCKED_VERSIONS", nil))
233233
end
234234

@@ -730,9 +730,9 @@ def ignored_versions_for(dep)
730730

731731
def blocked_versions_for(dep)
732732
$options[:blocked_versions]
733-
.select { |bv| bv["dependency-name"] && bv["version"] }
733+
.select { |bv| bv["dependency-name"] && bv["version-requirement"] }
734734
.select { |bv| bv["dependency-name"].casecmp(dep.name).zero? }
735-
.map { |bv| bv["version"] }
735+
.map { |bv| bv["version-requirement"] }
736736
end
737737

738738
def security_advisories
@@ -794,7 +794,7 @@ def security_fix?(dependency)
794794
if $options[:blocked_versions].any?
795795
puts "=> blocked versions active:"
796796
$options[:blocked_versions].each do |bv|
797-
msg = " #{bv['dependency-name']} #{bv['version']}"
797+
msg = " #{bv['dependency-name']} #{bv['version-requirement']}"
798798
msg += " (#{bv['reason']})" if bv["reason"]
799799
puts msg
800800
end

0 commit comments

Comments
 (0)