Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions lib/github_advisory_sync.rb
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,18 @@ def updating?
end

def filename
File.join("gems", name, "#{@advisory.primary_id}.yml")
# These packages appear to have been named differently in the past
# This 'corrects' them so updates don't affect existing vulnerabilities
package_name = case name
when "arabic-prawn"
"Arabic-Prawn"
when "redcloth"
"RedCloth"
else
name
end

File.join("gems", package_name, "#{@advisory.primary_id}.yml")
end

def framework
Expand Down Expand Up @@ -414,7 +425,7 @@ def create(package)

# populate the related information
new_data["related"] = {
"url" => advisory["references"]
"url" => advisory["references"].map { |reference| reference['url'] }.reject(&:empty?)
}

FileUtils.mkdir_p(File.dirname(filename_to_write))
Expand Down